Questions tagged [free]

The tag has no usage guidance.

2 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
1
vote
0answers
2k views

Valgrind says "Invalid read of size 4" while freeing memory recursively in a trie

My PSET "mispelling" works fine and contains no memory leak but when I run the program with Valgrind it says Invalid read of size 4. My unload function calls a deleteTrie function which looks like ...
0
votes
1answer
7 views

free_family does not work properly | INHERITANCE

I have executed following code for free family function - void free_family(person *p) { // TODO: Handle base case if(p->parents[0] == NULL && p->parents[1] == NULL) { ...