From: Jaroslav Kysela Date: Wed, 16 Jun 2021 15:47:52 +0000 (+0200) Subject: a52: fix memory leak in the close callback X-Git-Tag: v1.2.6~12 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=1aa625a537fffe833cecc1ad71f8390e8a5e0dbe;p=alsa-plugins.git a52: fix memory leak in the close callback Signed-off-by: Jaroslav Kysela --- diff --git a/a52/pcm_a52.c b/a52/pcm_a52.c index 6aae56a..d28c8c3 100644 --- a/a52/pcm_a52.c +++ b/a52/pcm_a52.c @@ -802,10 +802,9 @@ static int a52_close(snd_pcm_ioplug_t *io) snd_pcm_t *slave = rec->slave; a52_free(rec); - if (slave) { - rec->slave = NULL; + free(rec); + if (slave) return snd_pcm_close(slave); - } return 0; }