X-Git-Url: http://the.earth.li/gitweb/?a=blobdiff_plain;f=hash.c;h=f07017a669d7e65342ce81637d801d0548bb9f59;hb=e01d2e2d07392eb03e4268fdc4f0f1339a9a9461;hp=e29017cda8a98e286dbcb3ab1c7e81537276328b;hpb=6d98e0138f8ef5963d98448871b13e1cf2356c64;p=onak.git 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;