GNOME Bugzilla – Bug 158756
gconf_client_notify leaks
Last modified: 2005-07-13 13:16:24 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)
Created attachment 33950 [details] testcase.c
Created attachment 48798 [details] [review] proposed patch gconf_client_notify() creates new GConfEntry, so it must free (unref) it.
Thanks Aivars, looks good to me. Please commit to the gnome-2-10 and HEAD branches.
* gconf/gconf-client.c (gconf_client_notify): unref GConfEntry after notifying client. Fixes bug #158756
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)