#include "keydb.h"
#include "keyid.h"
#include "ll.h"
+#include "mem.h"
#include "stats.h"
/**
{
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_statskey);
hashtable[i] = NULL;
}
elements = 0;
{
struct stats_key *key = NULL;
+ if (keyid == 0) {
+ return NULL;
+ }
+
key = findinhash(keyid);
if (key == NULL) {
key = malloc(sizeof(*key));