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 333945 - mem leak in ev-metadata-manager
mem leak in ev-metadata-manager
Status: RESOLVED FIXED
Product: evince
Classification: Core
Component: general
git master
Other Linux
: Normal normal
: ---
Assigned To: Evince Maintainers
Evince Maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-08 20:56 UTC by Christian Persch
Modified: 2006-03-14 19:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch (2.10 KB, patch)
2006-03-09 18:57 UTC, Carlos Garcia Campos
committed Details | Review

Description Christian Persch 2006-03-08 20:56:03 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.
Comment 1 Christian Persch 2006-03-08 21:34:41 UTC
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)
Comment 2 Carlos Garcia Campos 2006-03-09 18:57:24 UTC
Created attachment 60995 [details] [review]
Patch

Here is a patch that fixes both memleaks.
Comment 3 Nickolay V. Shmyrev 2006-03-09 22:57:23 UTC
Thanks for the patch
Comment 4 Carlos Garcia Campos 2006-03-14 18:37:34 UTC
2006-03-14  Carlos Garcia Campos  <carlosgc@gnome.org>

        * shell/ev-metadata-manager.c (parseItem):

        Fix memory leaks. Fixes bug #333945
Comment 5 Nickolay V. Shmyrev 2006-03-14 18:44:44 UTC
We need to change this in gedit also. Reopening as a reminder
Comment 6 Carlos Garcia Campos 2006-03-14 19:04:29 UTC
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 :-)