X-Git-Url: https://git.sommitrealweird.co.uk/onak.git/blobdiff_plain/e01d2e2d07392eb03e4268fdc4f0f1339a9a9461..8bb45b1dfe6b5b30d89f154c16fb3eb8c049f496:/hash.c diff --git a/hash.c b/hash.c index f07017a..e131d03 100644 --- a/hash.c +++ b/hash.c @@ -13,6 +13,7 @@ #include "keydb.h" #include "keyid.h" #include "ll.h" +#include "mem.h" #include "stats.h" /** @@ -55,7 +56,7 @@ void destroyhash(void) * TODO: The problem is the object has pointers that * need freed too. */ - llfree(curll, free); + llfree(curll, free_statskey); hashtable[i] = NULL; } elements = 0; @@ -138,6 +139,10 @@ struct ll *hash_getkeysigs(uint64_t keyid) { struct stats_key *key = NULL; + if (keyid == 0) { + return NULL; + } + key = findinhash(keyid); if (key == NULL) { key = malloc(sizeof(*key));