It is generally advised to assign NULL to a freed up pointer as otherwise it may lead to dangling pointer. I want to know if there is any case where not assigning NULL has some use?
If not, why is it not implemented in the call to 'free()' itself? I understand that the pointer is passed by value and thus cannot be modified. Could the function free() have been be implemented to accept pointer to a pointer(i.e reference to the pointer) where the pointer(not pointer to pointer) points to NULL in the end?
I am asking this since we have to always keep in mind about assigning NULL to pointer after freeing which is a very commonly called function(I am assuming).