Fix missing braces

This commit is contained in:
Stuart Reilly
2019-06-28 16:21:49 +01:00
parent ef1b8e36a0
commit f3161309ff
+4 -3
View File
@@ -23,10 +23,10 @@ hashtable_t *ht_create(int size) {
return NULL;
/* Allocate pointers to the head nodes. */
if((hashtable->table = ndpi_malloc(sizeof(entry_t *) * size)) == NULL)
if((hashtable->table = ndpi_malloc(sizeof(entry_t *) * size)) == NULL) {
free(hashtable);
return NULL;
else {
} else {
for(i = 0; i < size; i++)
hashtable->table[i] = NULL;
}
@@ -62,9 +62,10 @@ entry_t *ht_newpair(char *key, u_int16_t value) {
if((newpair = ndpi_malloc(sizeof(entry_t))) == NULL)
return NULL;
if((newpair->key = ndpi_strdup(key)) == NULL)
if((newpair->key = ndpi_strdup(key)) == NULL) {
free(newpair);
return NULL;
}
newpair->value = value, newpair->next = NULL;