Re: @AndrewInIreland
"Wasting time and space with redundant local variables. (Just return errno at the end.)"
From here:
"The setting of errno after a successful call to a function is unspecified unless the description of that function specifies that errno shall not be modified." However, free() does not mention its interaction with errno...
i.e. a POSIX compliant free()
could potentially corrupt errno
. (I've known implementations that will reset it to zero.)