After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 347311 - element_unlink leaks its iterator wich will leak the src element ref
element_unlink leaks its iterator wich will leak the src element ref
Status: RESOLVED FIXED
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
git master
Other Linux
: Normal critical
: 0.10.10
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-07-12 14:25 UTC by Antoine Tremblay
Modified: 2006-07-14 18:00 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch to free the iterator (224 bytes, patch)
2006-07-12 14:29 UTC, Antoine Tremblay
committed Details | Review
patch with unit test showing the leak against tests/check/gst/gstutils.c (1.02 KB, patch)
2006-07-14 10:07 UTC, Tim-Philipp Müller
committed Details | Review

Description Antoine Tremblay 2006-07-12 14:25:55 UTC
In the element_unlink function the iterator is not freed and since it's a gst_element_iterator , the element is reffed by the iterator so if the iterator is not freed we leak a ref of the element... wich is kinda bad in _unlink since all the elements can have a ref leaked
Comment 1 Antoine Tremblay 2006-07-12 14:29:10 UTC
Created attachment 68819 [details] [review]
Patch to free the iterator
Comment 2 Tim-Philipp Müller 2006-07-14 10:07:06 UTC
Created attachment 68915 [details] [review]
patch with unit test showing the leak against tests/check/gst/gstutils.c
Comment 3 Jan Schmidt 2006-07-14 10:36:59 UTC
Actually, as discussed on IRC, I think it's better if we hold off on this until after the release. As pointed out by thomasvs we've traditionally been bitten about 50% of the time by including unref patches without thorough testing, because of apps that have somehow been relying on the behaviour.

It will be better to know if it breaks anything and provide the app authors some warning.
Comment 4 Tim-Philipp Müller 2006-07-14 16:21:50 UTC
Thanks for the patch, committed to CVS:

  2006-07-14  Tim-Philipp Müller  <tim at centricular dot net>

        Patch by: Antoine Tremblay <hexa00 at gmail com>

        * gst/gstutils.c: (gst_element_unlink):
          Free iterator when done (#347311).

        * tests/check/gst/gstutils.c: (GST_START_TEST), (gst_utils_suite):
          And add a test case for this.