I have successfully written a code that can spell check from loading a dictionary. To free the memory, I have written the unload() function and valgrind shows no memory leaks. But after submission, I am getting some cryptic errors, i.e.
Conditional jump or move depends on uninitialised value(s): (file: dictionary.c, line: 137)
Conditional jump or move depends on uninitialised value(s): (file: dictionary.c, line: 143)
Below are my unload() function, valgrind screenshot and submit50 result respectively. Please help.
Thanks.
//unload function
bool unload(void)
{
for (int i = 0; i < N; i++)
{
node* temp = table[i];
node* cursor = temp;
while (temp != NULL)
{
cursor = temp->next;
free(temp);
temp = cursor;
}
free(cursor);
}
return true;
}