Fix missing braces
This commit is contained in:
Vendored
+4
-3
@@ -23,10 +23,10 @@ hashtable_t *ht_create(int size) {
|
|||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
/* Allocate pointers to the head nodes. */
|
/* 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);
|
free(hashtable);
|
||||||
return NULL;
|
return NULL;
|
||||||
else {
|
} else {
|
||||||
for(i = 0; i < size; i++)
|
for(i = 0; i < size; i++)
|
||||||
hashtable->table[i] = NULL;
|
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)
|
if((newpair = ndpi_malloc(sizeof(entry_t))) == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if((newpair->key = ndpi_strdup(key)) == NULL)
|
if((newpair->key = ndpi_strdup(key)) == NULL) {
|
||||||
free(newpair);
|
free(newpair);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
newpair->value = value, newpair->next = NULL;
|
newpair->value = value, newpair->next = NULL;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user