Can someone please verify for me that the following statement is true? I have been writing my code assuming this:
If I allocate memory for a local variable using malloc/realloc that when the variable goes out of scope - the memory associated with the variable is automatically freed?
I also assume this is also true if I return a pointer from a function to memory alloc'd and when the variable outside the function goes out of scope that the memory will be automatically freed.