From 6ff314c75a4466536c39b143c156baa64011f516 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Sebastian=20Dr=C3=B6ge?= Date: Sun, 13 Jun 2010 16:27:39 +0200 Subject: [PATCH] pad: Fix iterator aggregation of all pads in the internal links fallback g_list_prepend() returns the new head of the list and not using this will create a memory leak and a single-element list. --- gst/gstpad.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gst/gstpad.c b/gst/gstpad.c index 6df6a7f..90c8577 100644 --- a/gst/gstpad.c +++ b/gst/gstpad.c @@ -3266,9 +3266,9 @@ gst_pad_iterate_internal_links (GstPad * pad) #ifndef GST_REMOVE_DEPRECATED static void -add_unref_pad_to_list (GstPad * pad, GList * list) +add_unref_pad_to_list (GstPad * pad, GList ** list) { - list = g_list_prepend (list, pad); + *list = g_list_prepend (*list, pad); gst_object_unref (pad); } #endif @@ -3318,7 +3318,7 @@ gst_pad_get_internal_links_default (GstPad * pad) /* loop over the iterator and put all elements into a list, we also * immediatly unref them, which is bad. */ do { - ires = gst_iterator_foreach (it, (GFunc) add_unref_pad_to_list, res); + ires = gst_iterator_foreach (it, (GFunc) add_unref_pad_to_list, &res); switch (ires) { case GST_ITERATOR_OK: case GST_ITERATOR_DONE: -- 2.7.4