memory leak in applet_menu_item_add_complex_separator_helper

Bug #784711 reported by JKL
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
network-manager-applet (Ubuntu)
Fix Released
High
Mathieu Trudel-Lapierre

Bug Description

Please review applet_menu_item_add_complex_separator_helper (after the indicator patch has been applied).

The first line is

 GtkWidget *menu_item = gtk_image_menu_item_new ();

And then if the indicator is enabled, the next line executed is

 menu_item = gtk_separator_menu_item_new ();

That is an obvious memory leak. Here is an associated valgrind log entry:

==10301== 6,656 bytes in 32 blocks are definitely lost in loss record 9,248 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 0x8F79915: g_slice_alloc0 (gslice.c:854)
==10301== by 0x88ED398: g_type_create_instance (gtype.c:1869)
==10301== by 0x88CB76B: g_object_constructor (gobject.c:1615)
==10301== by 0x88CE388: g_object_newv (gobject.c:1479)
==10301== by 0x88CF63B: g_object_new (gobject.c:1308)
==10301== by 0x41A03C: applet_menu_item_add_complex_separator_helper (applet.c:440)
==10301== by 0x42B1D8: wireless_add_menu_item (applet-device-wifi.c:960)
==10301== by 0x41A97E: indicator_update_menu (applet.c:1456)
==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)

Changed in network-manager-applet (Ubuntu):
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Mathieu Trudel-Lapierre (mathieu-tl)
status: Confirmed → In Progress
Revision history for this message
Mathieu Trudel-Lapierre (cyphermox) wrote :

Setting to Fix Committed since it's now in the packaging branch for nm-applet: lp:~network-manager/network-manager-applet/ubuntu.head

Changed in network-manager-applet (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package network-manager-applet - 0.8.9997+git.20110529t170033.9ec4c5d-0ubuntu1

---------------
network-manager-applet (0.8.9997+git.20110529t170033.9ec4c5d-0ubuntu1) oneiric; urgency=low

  * upstream snapshot 2011-05-29 17:00:33 (GMT)
    + 9ec4c5de855de5d9ee6c17752c3b0de6c68e9384
    - applet: fix leak in import/upgrade code (LP: #784756)
  * debian/rules: switch back to git "master" branch.
  * debian/patches/0001-applet-fix-possibly-uninitialized-variable.patch: drop,
    this is fixed upstream.
  * debian/patches/04-autostart.patch: refreshed.
  * debian/patches/20_use_full_vpn_dialog_service_name_path.patch: refreshed.
  * debian/patches/lp328572-dxteam-connect-text.patch: refreshed.
  * debian/patches/lp337960_dxteam_notification_icon_names.diff: refreshed.
  * debian/patches/lp341684_device_sensitive_disconnect_notify.patch: refresh.
  * debian/patches/lp460144_correctly_update_notification.patch: refreshed.
  * debian/patches/lp341684_device_sensitive_disconnect_notify.patch: refresh.
  * debian/patches/lp358526_generic_disconnected_notification_icon.patch:
    refreshed.
  * debian/patches/nm-applet-use-indicator.patch: refreshed and modified to
    build with GTK3 appindicator.
    - properly free icon_name for indicators (LP: #724554), thanks JKL.
    - fix leak in applet_menu_item_add_complex_separator_helper due to new'ing
      a GtkSeparatorMenuItem on top of a GtkImageMenuItem (LP: #784711).
  * debian/control:
    - Bump Build-Depends to libappindicator3-dev.
    - Update Build-Depends for GTK to libgtk-3-dev.
    - Bump network-manager and libnm Depends and Build-Depends to 0.8.998.
  * debian/rules, debian/patches/series: pass --libexecdir to configure, which
    now renders the patch 20_use_full_vpn_dialog_service_name_path.patch
    unnecessary, so we're dropping it.
  * debian/patches/20_use_full_vpn_dialog_service_name_path.patch: dropped,
    see above.
 -- Mathieu Trudel-Lapierre <email address hidden> Mon, 30 May 2011 13:25:18 -0400

Changed in network-manager-applet (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.