]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pcm_usb_stream: fix another leak in snd_pcm_us_open()
authorJaroslav Kysela <perex@perex.cz>
Tue, 23 Oct 2018 06:39:16 +0000 (08:39 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 23 Oct 2018 06:39:16 +0000 (08:39 +0200)
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
usb_stream/pcm_usb_stream.c

index eb4ca981c5f186c2d0f39574c79755f644169d34..5ca1c0f0d04ec37a87fc36998c1e4ea994b9923c 100644 (file)
@@ -424,8 +424,10 @@ static int snd_pcm_us_open(snd_pcm_t **pcmp, const char *name,
        }
        VDBG("%i %s", stream, us_name);
        us->uus = get_uus(card);
-       if (!us->uus)
+       if (!us->uus) {
+               free(us);
                return -ENOMEM;
+       }
        err = snd_hwdep_open(&us->hwdep, us_name, O_RDWR);
        if (err < 0) {
                us_free(us);