#memory leak help

13 messages · Page 1 of 1 (latest)

alpine ledgeBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

full breach
#

Can't tell unless you post the rest of the code mentioned by valgrind

minor hill
#

which part?

full breach
#

append_linked_list() and infix_to_postfix()

#

Also the type definitions for the ones used there, at least Stack

hollow sinew
#

Valgrind is pretty good, either you're passing in the wrong size t, or someone you're not actually saving the malloced ptr into data. I'd suggest refactoring the code to safe the pointer to a temporary first out side of the if statement.

#

Essentially expand out the entire expression onto seperate lines untill you can see exactly what it's not happy with

minor hill
#

it was basically happening when I was popping an element, i wasnt freeing the memory for that popped element

#

ty for the help anyways

alpine ledgeBOT
#

@minor hill Has your question been resolved? If so, run !solved :)

minor hill
#

!solved

alpine ledgeBOT
#

Thank you and let us know if you have any more questions!