From: Jaroslav Kysela Date: Thu, 29 Jul 2021 12:51:55 +0000 (+0200) Subject: a52: fix the double free for rec->slave and rec X-Git-Tag: v1.2.6~5 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=da157e978d73f1947bb77637c324e19d003366d4;p=alsa-plugins.git a52: fix the double free for rec->slave and rec The function snd_pcm_ioplug_delete() calls the close ops callback already, thus exit more early in the error path. Fixes: https://github.com/alsa-project/alsa-plugins/issues/31 Signed-off-by: Jaroslav Kysela --- diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 28dbd93..289a9db 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -1179,7 +1179,7 @@ SND_PCM_PLUGIN_DEFINE_FUNC(a52) if ((err = a52_set_hw_constraint(rec)) < 0) { snd_pcm_ioplug_delete(&rec->io); - goto error; + return err; } *pcmp = rec->io.pcm;