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 785219 - MEMORY_LEAK in function gst_harness_element_ref
MEMORY_LEAK in function gst_harness_element_ref
Status: RESOLVED INVALID
Product: GStreamer
Classification: Platform
Component: gstreamer (core)
1.12.2
Other All
: Normal minor
: git master
Assigned To: GStreamer Maintainers
GStreamer Maintainers
Depends on:
Blocks:
 
 
Reported: 2017-07-21 10:19 UTC by Ashish Kumar
Modified: 2017-07-21 10:26 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Ashish Kumar 2017-07-21 10:19:23 UTC
Dynamic memory referenced by '__p' was allocated at gstharness.c:452 by calling function 'g_malloc0_n', but not freed if g_object_set_data_full fails due to unsatisfied  expression check.

File:gstharness.c
Line no. 452
    data = g_new0 (guint, 1);
    *data = 1;
    g_object_set_data_full (G_OBJECT (h->element), HARNESS_REF, data, g_free);



File:gobject.c

g_object_set_data_full (GObject       *object,
                        const gchar   *key,
                        gpointer       data,
                        GDestroyNotify destroy)
{
  g_return_if_fail (G_IS_OBJECT (object)); //memory leak if returns from here 
  g_return_if_fail (key != NULL); //memory leak if returns from here
Comment 1 Sebastian Dröge (slomo) 2017-07-21 10:26:18 UTC
These are programming errors, and if that happens everything is in an inconsistent state anyway. Leaking some memory is not going to make that worse.

You'll find lots of other cases where memory is leaked if any of these assertions are failing.