]> git.alsa-project.org Git - alsa-lib.git/commitdiff
ucm: Set uc_mgr->ctl to NULL after closing it.
authorTanu Kaskinen <tanuk@iki.fi>
Sat, 26 Jan 2013 12:20:20 +0000 (14:20 +0200)
committerTakashi Iwai <tiwai@suse.de>
Mon, 28 Jan 2013 09:22:30 +0000 (10:22 +0100)
Fixes a double-free bug.

Signed-off-by: Tanu Kaskinen <tanuk@iki.fi>
Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
src/ucm/main.c

index 0d7d84147c4c79ab57047e150133b97e31c7860b..d8b8adaac4e92728326a2effbb1e101c4a311b7a 100644 (file)
@@ -145,6 +145,7 @@ static int open_ctl(snd_use_case_mgr_t *uc_mgr,
                free(uc_mgr->ctl_dev);
                uc_mgr->ctl_dev = NULL;
                snd_ctl_close(uc_mgr->ctl);
+               uc_mgr->ctl = NULL;
        
        }
        err = snd_ctl_open(ctl, ctl_dev, 0);