summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2013-02-28 16:59:57 +0000
committerVincent Penquerc'h <vincent.penquerch@collabora.co.uk>2013-02-28 16:59:57 +0000
commite2af84a9ab3acfb5c64d9934381e01382786604a (patch)
treeb524e7adc10b8a05d45e8dac98ecd94b233399c1
parentd6289c4d65fd6d7fc6dd44f0d0873001b1a16297 (diff)
downloadgstreamer-plugins-good-e2af84a9ab3acfb5c64d9934381e01382786604a.tar.gz
pulseaudiosink: fix error path leaks
-rw-r--r--ext/pulse/pulseaudiosink.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ext/pulse/pulseaudiosink.c b/ext/pulse/pulseaudiosink.c
index 22b439b47..547560a09 100644
--- a/ext/pulse/pulseaudiosink.c
+++ b/ext/pulse/pulseaudiosink.c
@@ -644,7 +644,7 @@ static void
proxypad_blocked_cb (GstPad * pad, gboolean blocked, gpointer data)
{
GstPulseAudioSink *pbin = GST_PULSE_AUDIO_SINK (data);
- GstCaps *caps;
+ GstCaps *caps = NULL;
GstPad *sinkpad = NULL;
if (!blocked) {
@@ -676,8 +676,6 @@ proxypad_blocked_cb (GstPad * pad, gboolean blocked, gpointer data)
} else
GST_DEBUG_OBJECT (pbin, "Doing nothing");
- gst_caps_unref (caps);
- gst_object_unref (sinkpad);
goto done;
}
/* pulsesink doesn't accept the incoming caps, so add a decodebin
@@ -703,6 +701,11 @@ done:
gst_pad_set_blocked_async_full (pad, FALSE, proxypad_blocked_cb,
gst_object_ref (pbin), (GDestroyNotify) gst_object_unref);
+ if (sinkpad)
+ gst_object_unref (sinkpad);
+ if (caps)
+ gst_caps_unref (caps);
+
GST_PULSE_AUDIO_SINK_UNLOCK (pbin);
}