mirror of
https://github.com/vel21ripn/nDPI.git
synced 2026-05-06 03:45:32 +00:00
Fix two resource leaks
This commit is contained in:
parent
d8ec0a9229
commit
79634a6789
1 changed files with 2 additions and 0 deletions
2
src/lib/third_party/src/ht_hash.c
vendored
2
src/lib/third_party/src/ht_hash.c
vendored
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue