#153 Several memory/resource leaks

None
closed-wont-fix
lxtask (23)
5
2014-09-16
2009-10-31
Reijo Tomperi
No

These were found from svn revision 2105 (2009-10-31)

These should be pretty obvious to see and fix:
[../lxde/trunk/devtools/xml-purge/xml-purge.c:32]: (error) Resource leak: fd
[../lxde/trunk/gpicview/src/xml-purge.c:32]: (error) Resource leak: fd
[../lxde/trunk/lxinput/src/xml-purge.c:32]: (error) Resource leak: fd
[../lxde/trunk/lxnm-applet/src/backend.c:424]: (error) Memory leak: lxnm
[../lxde/trunk/lxnm/src/handler.c:73]: (error) Memory leak: handler
[../lxde/trunk/lxnm/utils/getpppstat.c:181]: (error) Memory leak: gpppsdata
[../lxde/trunk/lxpanel/src/xml-purge.c:32]: (error) Resource leak: fd
[../lxde/trunk/lxsession-edit/src/xml-purge.c:32]: (error) Resource leak: fd
[../lxde/trunk/lxtask/src/xfce-taskmanager-linux.c:246]: (error) Memory leak: buffer

Here action is allocated with g_strdup() and then passed to spawn_app() using g_signal_connect(), but
spawn_app() doesn't release the memory.
[../lxde/trunk/lxpanel/src/plugins/menu.c:696]: (possible error) Memory leak: action

There is also one overlapping error:
[../lxde/trunk/lxpanel/src/plugins/cpufreq/cpufreq.c:206]: (error) Overlapping data buffer cpu_path

You can find here example of how the fixed similar overlapping error in the kernel:
http://lkml.indiana.edu/hypermail/linux/kernel/0812.0/02591.html

These bugs were found using Cppcheck: http://sourceforge.net/apps/mediawiki/cppcheck/

Discussion

  • And I will fix others leaks is there is no objections!

     
    • labels: --> lxtask
     
    • status: open --> closed-wont-fix
    • assigned_to: Lonely Stranger
    • Group: -->
     
  • Testing under valgrind shows no memory leaks in lxtask. And also call mentioned by you uses no allocated memory. Thank you very much.