[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

@@ -20,6 +20,7 @@
#include "common/stringlist.h"
#include "common/vector.h"
#include "common/debug.h"
#include <stdlib.h>
@@ -32,6 +33,12 @@ struct StringList
StringList stringlist_new(bool owns_strings)
{
StringList sl = malloc(sizeof(*sl));
if (!sl)
{
DEBUG_ERROR("out of memory");
return NULL;
}
sl->owns_strings = owns_strings;
if (!vector_create(&sl->vector, sizeof(char *), 32))