forked from github/server
more thorough cleanup of tokens.
This commit is contained in:
parent
3b5653b353
commit
e8ad542430
|
@ -211,8 +211,13 @@ void freetokens(void * root)
|
||||||
int i;
|
int i;
|
||||||
for (i = 0; node && i != NODEHASHSIZE; ++i) {
|
for (i = 0; node && i != NODEHASHSIZE; ++i) {
|
||||||
if (node->next[i]) {
|
if (node->next[i]) {
|
||||||
|
tref ** refs = &node->next[i];
|
||||||
freetokens(node->next[i]->node);
|
freetokens(node->next[i]->node);
|
||||||
free(node->next[i]);
|
while (*refs) {
|
||||||
|
tref * ref = *refs;
|
||||||
|
*refs = ref->nexthash;
|
||||||
|
free(ref);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
free(node);
|
free(node);
|
||||||
|
|
Loading…
Reference in New Issue