so I've been battling through the fifth pset and this is where I can not find a proper way to continue.
When I try to run it, it always aborts and gives this error: * Error in `./speller': double free or corruption (!prev): 0x0000000002526ca0 *
Code of the function (I am using a trie as a data structure):
bool unload(void)
{
current = root;
unloadreal(current);
return true;
}
bool unloadreal(node *node)
{
for (int i = 0; i < 27; i++)
{
if (current->children[i] != NULL)
{
current = current->children[i];
unloadreal(current);
}
}
free(current);
return true;
}