what happens if we don't free dynamically allocated memory code example
Example: what happens if we don't free dynamically allocated memory
But the memory allocation using malloc() is not de-allocated on its own.
So, “free()” method is used to de-allocate the memory. But the free()
method is not compulsory to use. If free() is not used in a program the
memory allocated using malloc() will be de-allocated after completion
of the execution of the program