[gpm] Memory Leak


I have been investigating a bug in Ubuntu, and have finally found the
root cause, and a way to reproduce the leak in the unpatched version
of GPM.

The bug in Ubuntu is

The bug is reproduced by continually right/left clicking on the
battery icon.  While doing this, approximately 4kB of data will be
leaked for each click.

The problem is caused by gpm_tray_icon_popup_menu_cb() and
gpm_tray_icon_activate_cb() calling gpm_tray_icon_popup_menu() then
calling gpm_tray_icon_create_menu().

gpm_tray_icon_create_menu() regenerates the menus every time it is
called, but not freeing the old one.

In Ubuntu the leak is really bad since the menu is updated on every
battery status change.  The Ubuntu patches make the problem occur more
quickly, but the leak is in the core code.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]