This conditioning is superfluous: free(NULL) is specified to be a safe no-op.  Since free is thus doing a conditional check against NULL, there is no win in your code duplicating that check.