diff options
author | Stuart Reilly <rs576h@vyatta.att-mail.com> | 2019-06-28 16:11:33 +0100 |
---|---|---|
committer | Stuart Reilly <rs576h@vyatta.att-mail.com> | 2019-06-28 16:11:33 +0100 |
commit | 79634a6789df2aedf59fb557699277563a8a4268 (patch) | |
tree | 559f0b9c656f16f20d3f3fd7dad22b2a84394c2d | |
parent | d8ec0a9229ce32b3194de4bda3ae11a5203d4df9 (diff) |
Fix two resource leaks
-rw-r--r-- | src/lib/third_party/src/ht_hash.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/third_party/src/ht_hash.c b/src/lib/third_party/src/ht_hash.c index 4eaac9bcb..ce50f1669 100644 --- a/src/lib/third_party/src/ht_hash.c +++ b/src/lib/third_party/src/ht_hash.c @@ -24,6 +24,7 @@ hashtable_t *ht_create(int size) { /* Allocate pointers to the head nodes. */ if((hashtable->table = ndpi_malloc(sizeof(entry_t *) * size)) == NULL) + free(hashtable); return NULL; else { for(i = 0; i < size; i++) @@ -62,6 +63,7 @@ entry_t *ht_newpair(char *key, u_int16_t value) { return NULL; if((newpair->key = ndpi_strdup(key)) == NULL) + free(newpair); return NULL; newpair->value = value, newpair->next = NULL; |