summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-01-03 07:33:23 +0000
committerAlexandre Ratchov <ratchov@cvs.openbsd.org>2017-01-03 07:33:23 +0000
commitac5a382b7aae599107224a9aa598e0e695243113 (patch)
tree9df9cd847fbc171830220e11b01f13e4fddcfaff /usr.bin
parenta0d3cc3e594f5631fc87513719e30d65e6b765cd (diff)
Assert we're not freeing buffers we didn't allocate (DEBUG mode).
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/aucat/abuf.c4
-rw-r--r--usr.bin/aucat/aucat.c16
2 files changed, 10 insertions, 10 deletions
diff --git a/usr.bin/aucat/abuf.c b/usr.bin/aucat/abuf.c
index ac79d49aab0..58db145865e 100644
--- a/usr.bin/aucat/abuf.c
+++ b/usr.bin/aucat/abuf.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: abuf.c,v 1.29 2016/09/30 08:43:23 ratchov Exp $ */
+/* $OpenBSD: abuf.c,v 1.30 2017/01/03 07:33:22 ratchov Exp $ */
/*
* Copyright (c) 2008-2012 Alexandre Ratchov <alex@caoua.org>
*
@@ -60,7 +60,7 @@ abuf_done(struct abuf *buf)
}
}
#endif
- free(buf->data);
+ xfree(buf->data);
buf->data = (void *)0xdeadbeef;
}
diff --git a/usr.bin/aucat/aucat.c b/usr.bin/aucat/aucat.c
index 4128757aa41..9780a408075 100644
--- a/usr.bin/aucat/aucat.c
+++ b/usr.bin/aucat/aucat.c
@@ -212,7 +212,7 @@ slot_new(char *path, int mode, struct aparams *par, int hdr,
if (!afile_open(&s->afile, path, hdr,
mode == SIO_PLAY ? AFILE_FREAD : AFILE_FWRITE,
par, rate, cmax - cmin + 1)) {
- free(s);
+ xfree(s);
return 0;
}
s->cmin = cmin;
@@ -430,14 +430,14 @@ slot_del(struct slot *s)
#endif
abuf_done(&s->buf);
if (s->resampbuf)
- free(s->resampbuf);
+ xfree(s->resampbuf);
if (s->convbuf)
- free(s->convbuf);
+ xfree(s->convbuf);
}
for (ps = &slot_list; *ps != s; ps = &(*ps)->next)
; /* nothing */
*ps = s->next;
- free(s);
+ xfree(s);
}
static void
@@ -727,9 +727,9 @@ dev_close(void)
if (dev_mh)
mio_close(dev_mh);
if (dev_mode & SIO_PLAY)
- free(dev_pbuf);
+ xfree(dev_pbuf);
if (dev_mode & SIO_REC)
- free(dev_rbuf);
+ xfree(dev_rbuf);
}
static void
@@ -1067,7 +1067,7 @@ offline(void)
slot_list_copy(todo, dev_pchan, dev_pbuf);
slot_list_iodo();
}
- free(dev_pbuf);
+ xfree(dev_pbuf);
while (slot_list)
slot_del(slot_list);
return 1;
@@ -1217,7 +1217,7 @@ playrec(char *dev, int mode, int bufsz, char *port)
if (dev_pstate == DEV_START)
dev_mmcstop();
- free(pfds);
+ xfree(pfds);
dev_close();
while (slot_list)
slot_del(slot_list);