Memory Leak Tree Build

87 views
Skip to first unread message

katie

unread,
Sep 24, 2020, 2:45:05 AM9/24/20
to cmpt-295-sfu
SFU ID: 301403922
Github username: katiesun138
Line and file: Tree.c Line 45

Question: When I ran Valgrind, I had some memory leaks (indefinite). I was wondering how I can fix this problem? If I free my malloc in the build_tree function, I won't be able to return any nodes.

Thank you,
Katie

kourosha...@gmail.com

unread,
Sep 24, 2020, 2:54:11 AM9/24/20
to cmpt-295-sfu

Following

Arrvindh Shriraman

unread,
Sep 24, 2020, 11:32:51 AM9/24/20
to cmpt-295-sfu
Think about when you can free the tree
You only need to follow the rules we have specified in the assignment page
Reply all
Reply to author
Forward
0 new messages