tsdemux: remove memory leak
authorLuis de Bethencourt <luisbg@osg.samsung.com>
Thu, 12 Nov 2015 12:00:07 +0000 (12:00 +0000)
committerLuis de Bethencourt <luisbg@osg.samsung.com>
Thu, 12 Nov 2015 12:08:15 +0000 (12:08 +0000)
The values of channel_mapping are copied by gst_codec_utils_opus_create_caps ()
but it doesn't free or take ownership of the g_new0 allocated memory. This
needs to be freed before going out of scope.

CID 1338692

gst/mpegtsdemux/tsdemux.c

index 7deb638..f1045da 100644 (file)
@@ -1357,6 +1357,8 @@ create_pad_for_stream (MpegTSBase * base, MpegTSBaseStream * bstream,
                     gst_codec_utils_opus_create_caps (48000, channels,
                     mapping_family, stream_count, coupled_count,
                     channel_mapping);
+
+                g_free (channel_mapping);
               }
             } else {
               GST_WARNING_OBJECT (demux,