Add efree() for consistency with emalloc() et al. Allows us to rely

on C89 behavior (free(NULL) is valid) even on K&R.
This commit is contained in:
Todd C. Miller
2005-03-29 14:29:47 +00:00
parent 9efe91fa1e
commit 304dc46d7f
19 changed files with 107 additions and 125 deletions

11
alloc.c
View File

@@ -211,3 +211,14 @@ evasprintf(ret, format, args)
errorx(1, "unable to allocate memory");
return(len);
}
/*
* Wrapper for free(3) so we can depend on C89 semantics.
*/
void
efree(ptr)
VOID *ptr;
{
if (ptr != NULL)
free(ptr);
}