summaryrefslogtreecommitdiff
path: root/usr.bin/sndiod
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-05-25 05:39:51 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2016-05-25 05:39:51 +0000
commit310140312968c930825729202f3e30ebd23a36e6 (patch)
tree039c22b8bef727e3faacefd5f00b51241ba1abdf /usr.bin/sndiod
parent30e25c883bcf756f5e0655007184cf996613f6dd (diff)
Assert we're not freeing buffers we didn't allocate
Diffstat (limited to 'usr.bin/sndiod')
-rw-r--r--usr.bin/sndiod/utils.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.bin/sndiod/utils.c b/usr.bin/sndiod/utils.c
index fac443e5870..e51812bb9f0 100644
--- a/usr.bin/sndiod/utils.c
+++ b/usr.bin/sndiod/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.2 2016/01/08 16:17:31 ratchov Exp $ */
+/* $OpenBSD: utils.c,v 1.3 2016/05/25 05:39:50 ratchov Exp $ */
/*
* Copyright (c) 2003-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -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);
}