GNOME Bugzilla – Bug 333945
mem leak in ev-metadata-manager
Last modified: 2006-03-14 19:04:29 UTC
==16259== 320 bytes in 49 blocks are definitely lost in loss record 175 of 305 ==16259== at 0x401B422: malloc (vg_replace_malloc.c:149) ==16259== by 0x45FA78F: xmlStrndup (in /usr/lib/libxml2.so.2.6.23) ==16259== by 0x45FA806: xmlStrdup (in /usr/lib/libxml2.so.2.6.23) ==16259== by 0x45FAE92: xmlStrcat (in /usr/lib/libxml2.so.2.6.23) ==16259== by 0x45AB1A1: xmlNodeListGetString (in /usr/lib/libxml2.so.2.6.23) ==16259== by 0x45B0707: xmlGetProp (in /usr/lib/libxml2.so.2.6.23) ==16259== by 0x8062CB3: load_values (ev-metadata-manager.c:202) ==16259== by 0x806322F: ev_metadata_manager_get (ev-metadata-manager.c:410) type = xmlGetProp (cur, (const xmlChar *)"type"); when you're done with |type|, it needs to be xmlFree'd. Should check if the same problem exists in gedit's metadata manager and forward the bug if necessary.
And another one: ==16958== 13,957 (2,076 direct, 11,881 indirect) bytes in 33 blocks are definitely lost in loss record 271 of 345 ==16958== at 0x401B422: malloc (vg_replace_malloc.c:149) ==16958== by 0x4CA2F36: g_malloc (gmem.c:131) ==16958== by 0x4CB2C65: g_strdup (gstrfuncs.c:91) ==16958== by 0x4C672DA: g_value_set_string (gvaluetypes.c:746) ==16958== by 0x8062E27: load_values (ev-metadata-manager.c:142) ==16958== by 0x806322F: ev_metadata_manager_get (ev-metadata-manager.c:410)
Created attachment 60995 [details] [review] Patch Here is a patch that fixes both memleaks.
Thanks for the patch
2006-03-14 Carlos Garcia Campos <carlosgc@gnome.org> * shell/ev-metadata-manager.c (parseItem): Fix memory leaks. Fixes bug #333945
We need to change this in gedit also. Reopening as a reminder
This memleak is not present in gedit code, since they store an string instead of a GValue in the hash_table and they don't have the "type" xml property. So closing it again :-)