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 158756 - gconf_client_notify leaks
gconf_client_notify leaks
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: gconf
2.8.x
Other Linux
: Normal normal
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-11-19 23:12 UTC by Christian Persch
Modified: 2005-07-13 13:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
testcase.c (1.08 KB, text/plain)
2004-11-19 23:13 UTC, Christian Persch
  Details
proposed patch (467 bytes, patch)
2005-07-07 20:59 UTC, Aivars Kalvans
accepted-commit_now Details | Review

Description Christian Persch 2004-11-19 23:12:50 UTC
Each time gconf_client_notify is called, a GConfEntry is leaked.

Testcase attached.

==18944== 19512 bytes in 542 blocks are definitely lost in loss record 79 of 82
==18944==    at 0x1B902A90: malloc (vg_replace_malloc.c:131)
==18944==    by 0xBCBB72: g_malloc (in /usr/lib/libglib-2.0.so.0.400.7)
==18944==    by 0x417E1B2: gconf_entry_new_nocopy (in /usr/lib/libgconf-2.so.4.1.0)
==18944==    by 0x4183429: gconf_engine_get_entry (in /usr/lib/libgconf-2.so.4.1.0)
==18944==    by 0x418768A: (within /usr/lib/libgconf-2.so.4.1.0)
==18944==    by 0x41886E4: gconf_client_get_entry (in /usr/lib/libgconf-2.so.4.1.0)
==18944==    by 0x4189E47: gconf_client_notify (in /usr/lib/libgconf-2.so.4.1.0)
Comment 1 Christian Persch 2004-11-19 23:13:05 UTC
Created attachment 33950 [details]
testcase.c
Comment 2 Aivars Kalvans 2005-07-07 20:59:54 UTC
Created attachment 48798 [details] [review]
proposed patch

gconf_client_notify() creates new GConfEntry, so it must free (unref) it.
Comment 3 Mark McLoughlin 2005-07-11 13:18:21 UTC
Thanks Aivars, looks good to me. Please commit to the gnome-2-10 and HEAD branches.
Comment 4 Aivars Kalvans 2005-07-13 12:49:31 UTC
        * gconf/gconf-client.c (gconf_client_notify): unref GConfEntry
        after notifying client. Fixes bug #158756
Comment 5 Mark McLoughlin 2005-07-13 13:16:24 UTC
Aivars: now that you've committed the patch, people have noticed that it doesn't
build. It should be gconf_entry_unref() rather than g_entry_unref()

Please compile and test all patches before submitting. Breaking the build really
isn't at all acceptable.

(Don't try and fix it now, someone else is fixing it as we speak)