From 7f569ca9c8c51ab4750c20771f37e0beeca3b050 Mon Sep 17 00:00:00 2001 From: Olivier CrĂȘte Date: Tue, 11 Aug 2009 14:47:12 -0400 Subject: rtpbin: Fix reference leak Fixes #591476. --- gst/rtpmanager/gstrtpbin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gst/rtpmanager') diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index c09b0ab9..ed9fa3ff 100644 --- a/gst/rtpmanager/gstrtpbin.c +++ b/gst/rtpmanager/gstrtpbin.c @@ -2331,13 +2331,15 @@ gst_rtp_bin_get_free_pad_name (GstElement * element, GstPadTemplate * templ) pad_name = g_strdup_printf (templ->name_template, session++); pad_it = gst_element_iterate_pads (GST_ELEMENT (element)); name_found = TRUE; - while (gst_iterator_next (pad_it, (gpointer) & pad) == GST_ITERATOR_OK) { + while (name_found && + gst_iterator_next (pad_it, (gpointer) & pad) == GST_ITERATOR_OK) { gchar *name; name = gst_pad_get_name (pad); if (strcmp (name, pad_name) == 0) name_found = FALSE; g_free (name); + gst_object_unref (pad); } gst_iterator_free (pad_it); } -- cgit