RebuildData structs are leaked in bridge.c

Bug #981340 reported by Charles Kerr
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
AppMenu GTK+
In Progress
Medium
Charles Kerr

Bug Description

rebuild() calls g_new0 to create a RebuildData struct "data", then uses it here:

> id = gdk_threads_add_timeout (100, (GSourceFunc)do_rebuild, data);

if we reach do_rebuild(), this is freed at the end of that function with a g_free():

> g_free (data);

...but rebuild() also calls g_source_remove(id). In this instance, that data field is leaked.

Revision history for this message
Charles Kerr (charlesk) wrote :

==16918== 456 bytes in 57 blocks are definitely lost in loss record 18,190 of 19,494
==16918== at 0x402A5E6: calloc (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so)
==16918== by 0x4C82752: standard_calloc (gmem.c:104)
==16918== by 0x4C82E6A: g_malloc0 (gmem.c:189)
==16918== by 0x10A6426B: rebuild (bridge.c:551)
==16918== by 0x10A651A2: app_menu_bridge_insert (bridge.c:908)
==16918== by 0x43C4DF5: ubuntu_menu_proxy_insert (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x43C63E7: gtk_menu_shell_insert (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EB3E8: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EA414: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EA414: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EA414: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EA414: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EA414: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EE4C7: gtk_ui_manager_ensure_update (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44EE551: ??? (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)
==16918== by 0x44ED705: gtk_ui_manager_get_widget (in /usr/lib/i386-linux-gnu/libgtk-3.so.0.400.0)

Charles Kerr (charlesk)
summary: - in bridge.c, RebuildData structs are leaked
+ RebuildData structs are leaked in bridge.c
Changed in appmenu-gtk:
status: New → Triaged
importance: Undecided → Low
assignee: nobody → Charles Kerr (charlesk)
status: Triaged → In Progress
importance: Low → Medium
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.