more thorough cleanup of tokens.

This commit is contained in:
Enno Rehling 2014-12-31 01:50:54 +01:00
parent 3b5653b353
commit e8ad542430
1 changed files with 6 additions and 1 deletions

View File

@ -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);