assert xfree() doesn't get NULL arg

This commit is contained in:
Alexandre Ratchov 2015-12-30 12:56:11 +01:00
parent 67bf8b7786
commit aa3d0b1ca1
1 changed files with 6 additions and 0 deletions

View File

@ -163,6 +163,12 @@ xmalloc(size_t size)
void
xfree(void *p)
{
#ifdef DEBUG
if (p == NULL) {
log_puts("xfree with NULL arg\n");
panic();
}
#endif
free(p);
}