GNOME Bugzilla – Bug 308546
Leak in g_key_file_load_from_data_dirs
Last modified: 2005-06-23 16:33:29 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)
Created attachment 48168 [details] [review] patch looks like a g_key_file bug to me... kjartan, can you test?
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?
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.
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.
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)