memory leak from make_memory_list_va

Bug #784369 reported by JKL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libgnome-keyring (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

The make_attribute_list_va function in library/gnome-keyring.c allocates a GnomeKeyringAttributeList which must be freed by the caller using the function gnome_keyring_attribute_list_free.

However, this does not happen in either case where the function is used. This is a contributing factor to the severe memory leak problems in nm-applet. Here is a relevant valgrind log from testing nm-applet:

==10301== 1,440 (288 direct, 1,152 indirect) bytes in 9 blocks are definitely lost in loss record 9,060 of 9,326
==10301== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==10301== by 0x8F62A62: g_malloc (gmem.c:164)
==10301== by 0x8F79666: g_slice_alloc (gslice.c:842)
==10301== by 0x8F2FE21: g_array_sized_new (garray.c:186)
==10301== by 0x5B16A86: make_attribute_list_va (gnome-keyring.c:2371)
==10301== by 0x5B1CEAF: gnome_keyring_find_itemsv_sync (gnome-keyring.c:2507)
==10301== by 0x44042F: copy_one_private_key_password (gconf-upgrade.c:1942)
==10301== by 0x443EF1: nm_gconf_migrate_0_7_certs (gconf-upgrade.c:2002)
==10301== by 0x43F862: nm_gconf_get_all_connections (gconf-helpers.c:1695)
==10301== by 0x4465A5: read_connections (nma-gconf-settings.c:234)
==10301== by 0x44665E: list_connections (nma-gconf-settings.c:270)
==10301== by 0x52701D1: impl_settings_list_connections (nm-settings-service.c:107)
==10301== by 0x526FEBB: dbus_glib_marshal_nm_settings_BOOLEAN__POINTER_POINTER (nm-settings-glue.h:97)
==10301== by 0x6584C4C: ??? (in /usr/lib/libdbus-glib-1.so.2.1.0)
==10301== by 0x8475A00: _dbus_object_tree_dispatch_and_unlock (dbus-object-tree.c:858)
==10301== by 0x8467B0F: dbus_connection_dispatch (dbus-connection.c:4688)
==10301== by 0x6582654: ??? (in /usr/lib/libdbus-glib-1.so.2.1.0)
==10301== by 0x8F5BBCC: g_main_context_dispatch (gmain.c:2440)
==10301== by 0x8F5C3A7: g_main_context_iterate.clone.6 (gmain.c:3091)
==10301== by 0x8F5C9F1: g_main_loop_run (gmain.c:3299)
==10301== by 0x416D77: main (main.c:101)

I think it is obvious what the patch should be, and it would be easier for a package maintainer to write it instead of having me mess around with quilt. Or perhaps this should be patched upstream, but I am not completely sure where that is.

For more information about how bad things are with nm-applet, see these bugs:

https://bugs.launchpad.net/ubuntu/+source/network-manager-applet/+bug/780602

https://bugs.launchpad.net/ubuntu/+source/appmenu-gtk/+bug/682786

Revision history for this message
JKL (jkl102001) wrote :
Revision history for this message
JKL (jkl102001) wrote :

Fixed upstream.

Changed in libgnome-keyring (Ubuntu):
status: New → Fix Committed
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Marking this Fix Released, due to the fix being done in 3.0.2 uploaded into Oneiric (which however doesn't include the dbus part, but I think this is covered in another bug (and if not, it should, since it will affect other projects))

Changed in libgnome-keyring (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.