There are a number of problems in this code. For starters, it's generating a seg fault in freelist. Fixing that leads to an infinite loop, indicating issues elsewhere. Additionally, it seems to be finding that every word is misspelled. All of these issues are likely intertwined.
This will be an excellent learning experience in debugging!
My suggestion at ...
Solved all problems:
reachable memory - in linked list added a new item in the end:
iterate to the last item in list (not to null, but the last which
allocate memory for new word in the list, add the word, and next -> null
free temporary node
also met with some errors, like:
==1281== HEAP SUMMARY:
==1281== in use at exit: 0 ...
It looks like most, if not all of the issues arise from one problem.
In the load function, near the bottom, I found this:
What happens when you free the node that you just created??? Doesn't it destroy the node that was just created at that address???
Copying the address to another location doesn't copy the node. So, if you have a dozen ...
The load function works perfectly
I'm afraid I'm gonna have to disagree. You're calling malloc twice when the list is empty. So that's one node per list that you can effectively never free, as the pointer to that node is immediately orphaned.
As for the unload function. You problems are limited to this section:
struct node *current_table = table[i]; ...
The bug is in your unload function. You return after cleaning up just 1 list. But you have 26 of them to get through. The outer loop is also out of bounds. You iterate up to N + 1 for some reason.
// Unloads dictionary from memory, returning true if successful, else false
for (int i = 0; i < (N + 1); i++) // Out of bounds. Should ...
It's a very subtle "possible" error that valgrind detected. When I ran it with the small dictionary, I get this:
==224== Conditional jump or move depends on uninitialised value(s)
==224== at 0x401CB1: unload (dictionary.c:145)
==224== by 0x40175F: main (speller.c:152)
==224== Uninitialised value was created by a heap allocation
==224== at ...