From: Olivier CrĂȘte Date: Tue, 11 Aug 2009 18:47:12 +0000 (-0400) Subject: rtpbin: Fix reference leak X-Git-Tag: 1.19.3~509^2~9772 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7f569ca9c8c51ab4750c20771f37e0beeca3b050;p=platform%2Fupstream%2Fgstreamer.git rtpbin: Fix reference leak Fixes #591476. --- diff --git a/gst/rtpmanager/gstrtpbin.c b/gst/rtpmanager/gstrtpbin.c index c09b0ab90d..ed9fa3ff6d 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); }