[syslog-ng] Fix several memory leaks caused by configuration reloading

Xufeng Zhang xufeng.zhang at windriver.com
Mon Apr 14 08:24:14 CEST 2014


Hello all,

Patch 1 is try to resolve below valgrind memory leak:
==25354== 26,112 bytes in 32 blocks are definitely lost in loss record 619 of 619
==25354== at 0x4A05F58: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25354== by 0x3A05A478F4: g_malloc (in /lib64/libglib-2.0.so.0.2600.0)
==25354== by 0x3A036416D2: log_writer_flush (logwriter.c:1020)
==25354== by 0x3A03641812: log_writer_deinit (logwriter.c:1138)
==25354== by 0x523AF4A: affile_dw_deinit (logpipe.h:268)
==25354== by 0x523B7EB: affile_dd_deinit (logpipe.h:268)
==25354== by 0x3A0362961E: cfg_tree_stop (logpipe.h:268)
==25354== by 0x3A036420DF: main_loop_reload_config_apply (mainloop.c:498)
==25354== by 0x3A036613FA: iv_signal_event (iv_signal.c:170)
==25354== by 0x3A0365FE48: iv_event_raw_got_event (iv_event_raw_posix.c:89)
==25354== by 0x3A03660511: iv_fd_poll_and_run (iv_fd.c:163)
==25354== by 0x3A03660C93: iv_main (iv_main_posix.c:117)

Patch 3 is try to resolve below valgrind memory leak:
==25354== 1,107 (176 direct, 931 indirect) bytes in 1 blocks are definitely lost in loss record 594 of 619
==25354== at 0x4A05F58: malloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==25354== by 0x3A05A478F4: g_malloc (in /lib64/libglib-2.0.so.0.2600.0)
==25354== by 0x3A0362FFEF: g_process_set_argv_space (gprocess.c:502)
==25354== by 0x40164C: main (main.c:196)

The memory leak problem which resolved by patch 2 is very clear.

The only concern from me is patch 1, would it cause any side effect?

Thanks!


More information about the syslog-ng mailing list