X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/7388adcea7ebace8d8c299da0e7c2e7e93da9c83..52ddc4bdd7c70336e8168332391ac066730391c2:/hash.c diff --git a/hash.c b/hash.c index e29017c..f07017a 100644 --- a/hash.c +++ b/hash.c @@ -48,20 +48,14 @@ void destroyhash(void) { int i; struct ll *curll = NULL; - struct ll *nextll = NULL; for (i = 0; i < HASHSIZE; i++) { curll = hashtable[i]; - while (curll != NULL) { - nextll = curll->next; - /* - * TODO: The problem is the object has pointers that - * need freed too. - */ - free(curll->object); - free(curll); - curll = nextll; - } + /* + * TODO: The problem is the object has pointers that + * need freed too. + */ + llfree(curll, free); hashtable[i] = NULL; } elements = 0;