From aa3d0b1ca1ae2fe0e77406a235743e7319b16b6c Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Wed, 30 Dec 2015 12:56:11 +0100 Subject: [PATCH] assert xfree() doesn't get NULL arg --- sndiod/utils.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sndiod/utils.c b/sndiod/utils.c index 67f6670..580b94c 100644 --- a/sndiod/utils.c +++ b/sndiod/utils.c @@ -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); }