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 308546 - Leak in g_key_file_load_from_data_dirs
Leak in g_key_file_load_from_data_dirs
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: general
2.6.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2005-06-21 17:06 UTC by Kjartan Maraas
Modified: 2005-06-23 16:33 UTC
See Also:
GNOME target: ---
GNOME version: 2.11/2.12


Attachments
patch (541 bytes, patch)
2005-06-22 17:28 UTC, Paolo Borelli
none Details | Review

Description Kjartan Maraas 2005-06-21 17:06:04 UTC
Valgrind reports this from nautilus:

==2382== 950 bytes in 19 blocks are definitely lost in loss record 9975 of 12027
==2382==    at 0x1B909222: malloc (vg_replace_malloc.c:130)
==2382==    by 0x1C4EDF99: g_malloc (gmem.c:137)
==2382==    by 0x1C4FE61D: g_strdup (gstrfuncs.c:91)
==2382==    by 0x1C4E4548: g_key_file_load_from_data_dirs (gkeyfile.c:344)
==2382==    by 0x1C147163: gnome_vfs_mime_info_desktop_entry_is_valid
(gnome-vfs-mime-info-cache.c:448)
==2382==    by 0x1C14832C: gnome_vfs_mime_get_all_desktop_entries
(gnome-vfs-mime-info-cache.c:718)
==2382==    by 0x1C1453A3: gnome_vfs_mime_get_default_application
(gnome-vfs-mime-handlers.c:220)
==2382==    by 0x1C1455A7: gnome_vfs_mime_get_default_application_for_uri
(gnome-vfs-mime-handlers.c:1935)
==2382==    by 0x1B9728E9: nautilus_mime_get_default_application_for_file
(nautilus-mime-actions.c:96)
==2382==    by 0x809450F: real_update_menus (fm-directory-view.c:6646)
==2382==    by 0x8098C38: fm_icon_view_update_menus (fm-icon-view.c:1533)
==2382==    by 0x80879DD: fm_directory_view_update_menus (fm-directory-view.c:7993)
Comment 1 Paolo Borelli 2005-06-22 17:28:20 UTC
Created attachment 48168 [details] [review]
patch

looks like a g_key_file bug to me... kjartan, can you test?
Comment 2 Kjartan Maraas 2005-06-23 09:24:03 UTC
I tested this and it seems to break adding new mime handlers under "Open With"
in the property browser. Does that work for you Paolo?
Comment 3 Paolo Borelli 2005-06-23 10:00:27 UTC
what do you mean by "break"? It seems to work for me from a quick test.

Beside I hardly see what can that have to do with the patch: "output_path" is a
local var of g_key_file_load_from_data_dirs which is either returned (if the
caller passes a non NULL full_path adress) or otherwise should be freed.
Comment 4 Kjartan Maraas 2005-06-23 12:40:26 UTC
the breakage was an unrelated crash in librsvg caused by a .png in my home
directory it seems, so this patch was not involved. This patch takes care of the
original gkeyfile.c related leak at least from what I see in my logs.
Comment 5 Matthias Clasen 2005-06-23 16:33:29 UTC
2005-06-23  Matthias Clasen  <mclasen@redhat.com>

	* tests/keyfile-test.c (test_group_remove): Don't leak
	memory here.

	* glib/gkeyfile.c (g_key_file_load_from_data_dirs): Don't
	leak output_path.  (#308546, Kjartan Maraas)