diff --git a/gst/mpegdemux/gstmpegdemux.c b/gst/mpegdemux/gstmpegdemux.c index 7d5b139050..d1f58d0796 100644 --- a/gst/mpegdemux/gstmpegdemux.c +++ b/gst/mpegdemux/gstmpegdemux.c @@ -399,8 +399,13 @@ gst_flups_demux_create_stream (GstFluPSDemux * demux, gint id, gint stream_type) break; } - if (name == NULL || template == NULL || caps == NULL) - return NULL; + if (name == NULL || template == NULL || caps == NULL) { + if (name) + g_free (name); + if (caps) + gst_caps_unref (caps); + return FALSE; + } stream = g_new0 (GstFluPSStream, 1); stream->id = id; diff --git a/gst/mpegdemux/gstmpegtsdemux.c b/gst/mpegdemux/gstmpegtsdemux.c index 5ee8daeb10..7d75bbeb03 100644 --- a/gst/mpegdemux/gstmpegtsdemux.c +++ b/gst/mpegdemux/gstmpegtsdemux.c @@ -829,8 +829,13 @@ gst_mpegts_demux_fill_stream (GstMpegTSStream * stream, guint8 id, default: break; } - if (name == NULL || template == NULL || caps == NULL) + if (name == NULL || template == NULL || caps == NULL) { + if (name) + g_free (name); + if (caps) + gst_caps_unref (caps); return FALSE; + } stream->stream_type = stream_type; stream->id = id;