From f3161309ff0b0900eb0c2745518df98311934c4a Mon Sep 17 00:00:00 2001 From: Stuart Reilly Date: Fri, 28 Jun 2019 16:21:49 +0100 Subject: Fix missing braces --- src/lib/third_party/src/ht_hash.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/lib/third_party/src/ht_hash.c b/src/lib/third_party/src/ht_hash.c index ce50f1669..838fc2c6d 100644 --- a/src/lib/third_party/src/ht_hash.c +++ b/src/lib/third_party/src/ht_hash.c @@ -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; -- cgit v1.2.3