Quote (lopelurag @ Mar 13 2013 09:29am)
Yeah the list actually works, memory is allocated correctly. It seems to be that my remove functions don't work correctly.
They work correctly, as in they remove the correct element, but for some reason there is a memory leak.
Think I fixed the mem leaks after printing out the malloc addresses before and after freeing
after reading valgrind logs again. could you quickly try freeing both the head and second element in the function at once and then running valgrind. just a guess but since its stating that it is indirectly loosing xx bytes in record 1 of 2 i could assume that it is just freaking out because you left 1 block un free'd.
simple way to test would just to be free both in one function then run it again. if thats the case you "could" ignore it or try searching for a possible cause of it. i think its just freaking out.
also if you did fix it grats.
and lol i got a flaming suspension for making this kid look dumb :/
This post was edited by AbDuCt on Mar 13 2013 12:36pm