aboutsummaryrefslogtreecommitdiff
path: root/src/ht.c
diff options
context:
space:
mode:
authorJacob Janzen <jacob.a.s.janzen@gmail.com>2024-02-14 12:40:50 -0600
committerJacob Janzen <jacob.a.s.janzen@gmail.com>2024-02-14 12:40:50 -0600
commit5304bd492183726f2f14b7d4f2bf817184ae0fa0 (patch)
treefd44b968197c9256491fb9911921b59437706920 /src/ht.c
parentb5b4a5d66deefa3858bedf7bc58e6c96340e829b (diff)
fix memory leak
Diffstat (limited to 'src/ht.c')
-rw-r--r--src/ht.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ht.c b/src/ht.c
index 39093eb..f44ea12 100644
--- a/src/ht.c
+++ b/src/ht.c
@@ -4,8 +4,6 @@
#include <stdlib.h>
#include <string.h>
-#define SIZE 1024
-
struct node {
char *key;
void *val;
@@ -56,6 +54,8 @@ static void rehash(ht_t *h, int newsize)
h->curr_index = 0;
h->curr_node = NULL;
h->iterating = false;
+
+ free(new_h);
}
static unsigned long djb2_hash(char *str)