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

This commit is contained in:
Geoffrey McRae
2022-03-07 10:13:54 +11:00
parent a3820536ab
commit 3a8cb6a613
18 changed files with 228 additions and 24 deletions

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;