From c2387d8bf667467ad79fc0a2327a4ce24bf77d02 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 8 Jun 2012 17:14:09 +0200 Subject: [PATCH] mpegtsmux: plug leaks when freeing stream --- gst/mpegtsmux/tsmux/tsmuxstream.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/gst/mpegtsmux/tsmux/tsmuxstream.c b/gst/mpegtsmux/tsmux/tsmuxstream.c index ac2b7b9cfe..56dce88a16 100644 --- a/gst/mpegtsmux/tsmux/tsmuxstream.c +++ b/gst/mpegtsmux/tsmux/tsmuxstream.c @@ -214,8 +214,20 @@ tsmux_stream_get_pid (TsMuxStream * stream) void tsmux_stream_free (TsMuxStream * stream) { + GList *cur; + g_return_if_fail (stream != NULL); + /* free buffers */ + for (cur = stream->buffers; cur; cur = cur->next) { + TsMuxStreamBuffer *tmbuf = (TsMuxStreamBuffer *) cur->data; + + if (stream->buffer_release) + stream->buffer_release (tmbuf->data, tmbuf->user_data); + g_slice_free (TsMuxStreamBuffer, tmbuf); + } + g_list_free (stream->buffers); + g_slice_free (TsMuxStream, stream); }