memory leak in bus_watcher_ready

Bug #784327 reported by JKL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libappindicator
Fix Released
Medium
Unassigned
libappindicator (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Line 1232 of app-indicator.c is:

gchar * name = g_dbus_proxy_get_name_owner(app->priv->watcher_proxy);

According to the documentation, the name object returned from this function must be freed using g_free().

http://developer.gnome.org/gio/2.28/GDBusProxy.html#g-dbus-proxy-get-name-owner

By reading the rest of the code, it does not look like the name is freed properly, nor is it ever used except to check whether it is null.

This issue was originally identified by running nm-applet under valgrind. The associated log entry is below.

==10301== 7 bytes in 1 blocks are definitely lost in loss record 254 of 9,326
==10301== at 0x4C28FAC: malloc (vg_replace_malloc.c:236)
==10301== by 0x8F62A62: g_malloc (gmem.c:164)
==10301== by 0x8F7B06D: g_strdup (gstrfuncs.c:102)
==10301== by 0x4E334E5: bus_watcher_ready (app-indicator.c:1232)
==10301== by 0x6CD6D48: complete_in_idle_cb (gsimpleasyncresult.c:757)
==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)

Note there are several existing bugs related to memory leaks in nm-applet. This is one minor contributing factor.

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

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

Related branches

Ted Gould (ted)
Changed in libappindicator (Ubuntu):
status: New → Confirmed
importance: Undecided → Medium
Changed in libappindicator:
status: New → In Progress
importance: Undecided → Medium
Ted Gould (ted)
Changed in libappindicator:
status: In Progress → Fix Committed
milestone: none → 0.3.90
Ted Gould (ted)
Changed in libappindicator:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libappindicator - 0.3.90-0ubuntu1

---------------
libappindicator (0.3.90-0ubuntu1) oneiric; urgency=low

  * debian/control: updated libindicator requirement.

  [ Ted Gould ]
  * New upstream release.
    * Fix a memory leak (LP: #784327)
    * Port to libindicator 0.4
 -- Sebastien Bacher <email address hidden> Fri, 08 Jul 2011 13:53:35 +0200

Changed in libappindicator (Ubuntu):
status: Confirmed → 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.