how can there be a memory leakage if the free() function is used on the ptr?
MCQ-pointers(ques4)
As we can see that ptr is NULL, if we call free() on a NULL pointer then no action occurs.
There might be some error in the pdf due to which memory leak has been given.
But in reality no action will happen if we call free() ptr, since it is a NULL pointer.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.