]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
pulse - Fix destruction order on failure
authorLennart Poettering <mznyfn@0pointer.de>
Thu, 25 Sep 2008 19:02:32 +0000 (21:02 +0200)
committerTakashi Iwai <tiwai@suse.de>
Fri, 26 Sep 2008 09:47:01 +0000 (11:47 +0200)
If we failure we should make sure the event loop thread is not running
and hence not accessing our source/sink strings before we free those
strings.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
pulse/ctl_pulse.c

index 0b10628f756c175b7fc6ff0c5ff28c44b35d1dc6..8a5546c589a2a1c4669ac8d182076afb3aadd9b4 100644 (file)
@@ -728,14 +728,11 @@ SND_CTL_PLUGIN_DEFINE_FUNC(pulse)
        return 0;
 
 error:
-       if (ctl->source)
-               free(ctl->source);
-       if (ctl->sink)
-               free(ctl->sink);
-
        if (ctl->p)
                pulse_free(ctl->p);
 
+       free(ctl->source);
+       free(ctl->sink);
        free(ctl);
 
        return err;