ratpoison-devel
[Top][All Lists]
Advanced

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

[RP] [PATCH] Free cmdret returned by frestore() in cmd_sfrestore()


From: Repolho
Subject: [RP] [PATCH] Free cmdret returned by frestore() in cmd_sfrestore()
Date: Wed, 7 Aug 2013 14:23:34 -0300
User-agent: Mutt/1.5.21 (2010-09-15)

action.c:cmd_sfrestore() fails to free the cmdret* returned by
frestore(), resulting in a leak for each screen, every time the function
is used.

To reproduce, run
$ ratpoison -c "sfrestore $(ratpoison -c sfdump)"
which results in (taken from valgrind's log):

16 bytes in 1 blocks are definitely lost in loss record 30 of 196
   at 0x4C2C04B: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x41BD4A: xmalloc (main.c:74)
   by 0x406D8A: cmdret_new (actions.c:814)
   by 0x40FFD9: frestore (actions.c:5009)
   by 0x41152A: cmd_sfrestore (actions.c:5567)
   by 0x40A842: command (actions.c:2557)
   by 0x415CC6: execute_remote_command (events.c:502)
   by 0x415DF0: receive_command (events.c:567)
   by 0x415F5A: property_notify (events.c:601)
   by 0x4165C3: delegate_event (events.c:830)
   by 0x416A71: listen_for_events (events.c:1008)
   by 0x41D103: main (main.c:749)

The attached patch fixes the issue. It was generated over the latest git,
v1.4.6-48-gb02d855.

Attachment: sfrestore_leak.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]