Checking for NULL has nothing to do with double frees.  Like the
man page explains, free(NULL) is a no-op.  It does absolutely nothing,
and there is no reason for your application to check if a pointer
is NULL before calling free on it.

Double-free is what happens when you try to free an allocated address
that has already been freed.  NULL is not such an address.  Checking
for NULL does not prevent double frees from occurring.

Reply via email to