Fix bug #4455
authorMichael Rasmussen <mir@datanom.net>
Fri, 5 Mar 2021 08:24:13 +0000 (09:24 +0100)
committerMichael Rasmussen <mir@datanom.net>
Fri, 5 Mar 2021 08:24:13 +0000 (09:24 +0100)
Signed-off-by: Michael Rasmussen <mir@datanom.net>
src/common/stringtable.c

index e9451817533a7e47fa9845cece2e9427447ebfaa..b0f747ed48f6197f3fae34649578805f9ba345ca 100644 (file)
@@ -64,7 +64,10 @@ StringTable *string_table_new(void)
        strtable = g_new0(StringTable, 1);
        cm_return_val_if_fail(strtable != NULL, NULL);
        strtable->hash_table = g_hash_table_new(g_str_hash, g_str_equal);
-       cm_return_val_if_fail(strtable->hash_table, NULL);
+        if (strtable->hash_table == NULL) {
+                g_free(strtable);
+                return NULL;
+        }
        return strtable;
 }