From 9b597200f4d9de80118570fffd1cc136dd4ab46c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sat, 21 Apr 2018 10:51:03 +0100 Subject: [PATCH] testsrcbin: fix memory leak CID 1434971 --- gst/debugutils/gsttestsrcbin.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gst/debugutils/gsttestsrcbin.c b/gst/debugutils/gsttestsrcbin.c index 76672a5555..4d7f70bd72 100644 --- a/gst/debugutils/gsttestsrcbin.c +++ b/gst/debugutils/gsttestsrcbin.c @@ -254,7 +254,7 @@ gst_test_src_bin_uri_handler_set_uri (GstURIHandler * handler, gchar *tmp, *location = gst_uri_get_location (uri); gint i, n_audio = 0, n_video = 0; GstStreamCollection *collection = gst_stream_collection_new (NULL); - GstIterator *it = gst_bin_iterate_elements (GST_BIN (self)); + GstIterator *it; GstCaps *streams_defs; for (tmp = location; *tmp != '\0'; tmp++) @@ -268,11 +268,14 @@ gst_test_src_bin_uri_handler_set_uri (GstURIHandler * handler, goto failed; /* Clear us up */ + it = gst_bin_iterate_elements (GST_BIN (self)); while (gst_iterator_foreach (it, (GstIteratorForeachFunction) gst_test_src_bin_remove_child, self) == GST_ITERATOR_RESYNC) gst_iterator_resync (it); + gst_iterator_free (it); + self->group_id = gst_util_group_id_next (); for (i = 0; i < gst_caps_get_size (streams_defs); i++) { GstStructure *stream_def = gst_caps_get_structure (streams_defs, i);