@ShadowLocke
This looks wrong to me.
If you have a function that takes a char *** parameter and uses it to pass back data then that function is expecting a pointer to an existing location but you do not pass a pointer to an existing location you pass the value of a pointer.
The only place GetWords has to write to in your function is the completely random and uninitialised address you pass in contained in lst.
Also from the name and return type it appears that the function is returning a list of words. Dynamically allocated that would be an array of pointers with each pointer pointing to allocated memory. A pointer to such an array would have type char **.
Taking all this in mind I think the 2 code lines above should actually be
- char **lst;
-
ll_cnt = GetWords(&lst);
-
passing the address of a char ** for the function to write the address of the array of strings to. Obviously the change of type would then also have an effect on the rest of your code.
At the moment I believe the 2 lines highlighted actually produce undefined behaviour as you are writing to an un-allocated memory address somewhere.
When a function takes a pointer then the majority of the time it wants the address of an allocated piece of memory or may be NULL, not an uninitialised pointer.