diff options
author | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-01-13 10:32:59 +0000 |
---|---|---|
committer | Tim-Philipp Müller <tim.muller@collabora.co.uk> | 2012-01-18 10:02:49 +0000 |
commit | ca7251bbe35625fa2fec543177abe5a41103a1fe (patch) | |
tree | 711007662b3182572b930a0e0c4c675f00104060 | |
parent | 82c07d02661c4fc2cadfecd1b2be921154c26df9 (diff) |
rtpptdemux: plug pad leak in error code path
Based on patch by: Stig Sandnes <stig.sandnes@cisco.com>
Don't leak srcpad if there are no caps.
https://bugzilla.gnome.org/show_bug.cgi?id=667820
-rw-r--r-- | gst/rtpmanager/gstrtpptdemux.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gst/rtpmanager/gstrtpptdemux.c b/gst/rtpmanager/gstrtpptdemux.c index 0679438fa..630212f0b 100644 --- a/gst/rtpmanager/gstrtpptdemux.c +++ b/gst/rtpmanager/gstrtpptdemux.c @@ -326,6 +326,10 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstBuffer * buf) GstPadTemplate *templ; gchar *padname; + caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt); + if (!caps) + goto no_caps; + klass = GST_ELEMENT_GET_CLASS (rtpdemux); templ = gst_element_class_get_pad_template (klass, "src_%d"); padname = g_strdup_printf ("src_%d", pt); @@ -334,10 +338,6 @@ gst_rtp_pt_demux_chain (GstPad * pad, GstBuffer * buf) g_free (padname); gst_pad_set_event_function (srcpad, gst_rtp_pt_demux_src_event); - caps = gst_rtp_pt_demux_get_caps (rtpdemux, pt); - if (!caps) - goto no_caps; - caps = gst_caps_make_writable (caps); gst_caps_set_simple (caps, "payload", G_TYPE_INT, pt, NULL); gst_pad_set_caps (srcpad, caps); |