[client/common] fixes for issues detected through static analysis.

This commit is contained in:
Geoffrey McRae committed 2022-03-07 10:14:52 +11:00
1 parent a3820536ab
commit 3a8cb6a613
18 files changed
+228 -24

No files matched your search

+12
View File
@@ -26,6 +26,12 @@
struct ll * ll_new(void)
{
struct ll * list = malloc(sizeof(*list));
if (!list)
{
DEBUG_ERROR("out of memory");
return NULL;
}
list->head = NULL;
list->tail = NULL;
list->count = 0;
@@ -45,6 +51,12 @@ void ll_free(struct ll * list)
void ll_push(struct ll * list, void * data)
{
struct ll_item * item = malloc(sizeof(*item));
if (!item)
{
DEBUG_ERROR("out of memory");
return;
}
item->data = data;
item->next = NULL;