I have been having a problem with PSET5 in unload, where it is giving me an error:
* Error in `/home/ubuntu/workspace/pset5/speller': free(): invalid next size (fast): 0x00000000006042d0 *
Child terminated with signal = 0x6 (SIGABRT)
GDBserver exiting
Does anyone know what this means? And how I should fix it? Here is my code for unload:
bool unload(void)
{
for (int i = 0; i < 26; i++) {
while (root[i] != NULL) {
node* tmp = root[i];
root[i] = root[i]->next;
if (root[i] != NULL) {
printf("%s\n",root[i]->word);
free(tmp);
}
}
}
return true;
}