Nope, you need one free for every malloc, and they happen in reverse order. You malloc the outer array *ls, then malloc (*ls)[0] to (*ls)[MAX], so you free (*ls)[0] to (*ls)[MAX], then free(*ls). ...
Type: Posts; User: anduril462
Nope, you need one free for every malloc, and they happen in reverse order. You malloc the outer array *ls, then malloc (*ls)[0] to (*ls)[MAX], so you free (*ls)[0] to (*ls)[MAX], then free(*ls). ...
First, you should learn to use a debugger. Then you can simply step through the code line by line, and follow exactly what is happening, examine variables, etc.
Second, you need to work on your...