From f977d7e743c3523687958446f6c4a455f67e0edd Mon Sep 17 00:00:00 2001 From: Thibault Saunier Date: Fri, 24 Feb 2012 15:26:21 -0300 Subject: [PATCH] tsdemux: Avoid unlinkely leaks and segfault --- gst/mpegtsdemux/tsdemux.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/gst/mpegtsdemux/tsdemux.c b/gst/mpegtsdemux/tsdemux.c index 357aafd328..5b70c44bbd 100644 --- a/gst/mpegtsdemux/tsdemux.c +++ b/gst/mpegtsdemux/tsdemux.c @@ -1270,10 +1270,13 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream, gst_pad_set_query_type_function (pad, gst_ts_demux_srcpad_query_types); gst_pad_set_query_function (pad, gst_ts_demux_srcpad_query); gst_pad_set_event_function (pad, gst_ts_demux_srcpad_event); - gst_caps_unref (caps); } - g_free (name); + if (name) + g_free (name); + + if (caps) + gst_caps_unref (caps); return pad; }