GNOME Bugzilla – Bug 650840
3.0.2's memleak fix (commit b49e32) causes segfaults
Last modified: 2019-02-22 11:46:09 UTC
Hello, After upgrading to libgnome-keyring 3.0.2 I noticed that nm-applet now crashes on startup:
+ Trace 227219
The problem seems to be in the recent memory leak fix: http://git.gnome.org/browse/libgnome-keyring/commit/?h=gnome-3-0&id=b49e32b32d4d7c326c3bd7dd44ca1c35944a94c4 gnome_keyring_find_itemsv_sync() now calls gnome_keyring_attribute_list_free() on the attribute list generated with make_attribute_list_va(). This is wrong, as the latter directly copies the (static) arguments from the caller, e. g. in nm-applet: ------------ 8< ------------ ret = gnome_keyring_find_itemsv_sync (GNOME_KEYRING_ITEM_GENERIC_SECRET, &found_list, "connection-id", GNOME_KEYRING_ATTRIBUTE_TYPE_STRING, old_id, NULL); ------------ 8< ------------ gnome_keyring_attribute_list_free() does not only free the actual array, but also all elements inside. It should perhaps just do a g_array_free() instead? Note that this doesn't happen on trunk (3.1.1), as this memleak fix was _only_ applied to the 3-0 branch instead of master.
Created attachment 188361 [details] [review] git formatted patch This fixes the crash, and I think the logic is correct now. This is also what make_attribute_list_va() does when it encounters an error. Does that look ok to you, can I push it? Do you want to handle the forward-porting of the memleak fix and this patch to master yourself, or want me to push that there, too?
This looks good. Thanks. Yes, please go ahead and push. A similar patch was done on bug #650606 and tested there. I can take care of merging the gnome-3-0 branch into master (in a few days).
Thanks, pushed.
*** Bug 651077 has been marked as a duplicate of this bug. ***
*** Bug 651049 has been marked as a duplicate of this bug. ***