Patch: Fixed signals memory leak

Denis F. Latypoff denis at gostats.ru
Fri Jun 19 16:21:47 CEST 2009


Hello Black,

Sunday, June 7, 2009, 3:58:50 PM, you wrote:

> Hi, there

> I found there are 256 bytes still reachable after ev_default_destroy():

> Valgrind log:

> ==1878== 256 bytes in 1 blocks are still reachable in loss record 1 of 2
> ==1878==    at 0x4025868: malloc (vg_replace_malloc.c:207)
> ==1878==    by 0x40259AC: realloc (vg_replace_malloc.c:429)
> ==1878==    by 0x804B675: ev_realloc (ev.c:467)
> ==1878==    by 0x804EFD8: ev_signal_start (ev.c:2477)
> ==1878==    by 0x804F1B5: ev_default_loop_init (ev.c:1724)
> ==1878==    by 0x8051357: SchedulerLibEv::SchedulerLibEv(char const*)
> (ev.h:454)
> ==1878==    by 0x804A2A7: main (test-timer-libev.cpp:80)
> ==1878==

> ev.c

> struct ANSIG *signals;

> alloced in ev_default_loop() -> ev_signal_init () ...

> but not freed in ev_default_destroy() -> ev_signal_stop ()

> Patch is attached.

More proper patch is attached.

-- 
Best regards,
 Denis                            mailto:denis at gostats.ru
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: libev-signals-free.patch.txt
URL: <http://lists.schmorp.de/pipermail/libev/attachments/20090619/d55cce23/attachment.txt>


More information about the libev mailing list