From d2102db943b5ccfbb9ec6282af25634251b89e9e Mon Sep 17 00:00:00 2001 From: Alexandre Ratchov Date: Mon, 29 Oct 2012 14:18:48 +0100 Subject: [PATCH] free() slot conversion & resampling buffers --- sndiod/dev.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/sndiod/dev.c b/sndiod/dev.c index 19b7698..ad73377 100644 --- a/sndiod/dev.c +++ b/sndiod/dev.c @@ -1888,8 +1888,13 @@ slot_stop(struct slot *s) } else s->pstate = SLOT_INIT; } - if (s->mode & MODE_RECMASK) + if (s->mode & MODE_RECMASK) { abuf_done(&s->sub.buf); + if (s->sub.encbuf) + xfree(s->sub.encbuf); + if (s->sub.resampbuf) + xfree(s->sub.resampbuf); + } if (s->pstate == SLOT_READY) { #ifdef DEBUG if (log_level >= 3) { @@ -1897,8 +1902,13 @@ slot_stop(struct slot *s) log_puts(": not drained (blocked by mmc)\n"); } #endif - if (s->mode & MODE_PLAY) + if (s->mode & MODE_PLAY) { abuf_done(&s->mix.buf); + if (s->mix.decbuf) + xfree(s->mix.decbuf); + if (s->mix.resampbuf) + xfree(s->mix.resampbuf); + } s->ops->eof(s->arg); s->pstate = SLOT_INIT; } else {