From 086cc58952ac1d98236da503ad08979f844ce8d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 20 Nov 2014 10:23:30 -0800 Subject: srtpdec: fix rtp/rtcp sink event memory leak https://bugzilla.gnome.org/show_bug.cgi?id=740451 --- ext/srtp/gstsrtpdec.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'ext/srtp') diff --git a/ext/srtp/gstsrtpdec.c b/ext/srtp/gstsrtpdec.c index 2caa57c32..debff15d1 100644 --- a/ext/srtp/gstsrtpdec.c +++ b/ext/srtp/gstsrtpdec.c @@ -757,13 +757,16 @@ gst_srtp_dec_sink_setcaps (GstPad * pad, GstObject * parent, static gboolean gst_srtp_dec_sink_event_rtp (GstPad * pad, GstObject * parent, GstEvent * event) { + gboolean ret; GstCaps *caps; GstSrtpDec *filter = GST_SRTP_DEC (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_CAPS: gst_event_parse_caps (event, &caps); - return gst_srtp_dec_sink_setcaps (pad, parent, caps, FALSE); + ret = gst_srtp_dec_sink_setcaps (pad, parent, caps, FALSE); + gst_event_unref (event); + return ret; case GST_EVENT_SEGMENT: filter->rtp_has_segment = TRUE; break; @@ -781,13 +784,16 @@ static gboolean gst_srtp_dec_sink_event_rtcp (GstPad * pad, GstObject * parent, GstEvent * event) { + gboolean ret; GstCaps *caps; GstSrtpDec *filter = GST_SRTP_DEC (parent); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_CAPS: gst_event_parse_caps (event, &caps); - return gst_srtp_dec_sink_setcaps (pad, parent, caps, TRUE); + ret = gst_srtp_dec_sink_setcaps (pad, parent, caps, TRUE); + gst_event_unref (event); + return ret; case GST_EVENT_SEGMENT: filter->rtcp_has_segment = TRUE; break; -- cgit v1.2.1