naemon / naemon-core

Networks, Applications and Event Monitor
http://www.naemon.io/
GNU General Public License v2.0
153 stars 63 forks source link

Memory leak while sending custom notifications #45

Closed pengi closed 10 years ago

pengi commented 10 years ago

Sending at least a custom host notificaiton gives a memory leak, caused by a strdup in the command handler for the field author and data.

Valgrind output:

==540== 10 bytes in 1 blocks are definitely lost in loss record 23 of 349 ==540== at 0x4C279EE: malloc (vg_replace_malloc.c:270) ==540== by 0x5338171: strdup (strdup.c:43) ==540== by 0x422417: process_host_command (commands.c:1438) ==540== by 0x422EAE: process_external_command1 (commands.c:886) ==540== by 0x446032: qh_command (query-handler.c:351) ==540== by 0x446315: qh_input (query-handler.c:193) ==540== by 0x473455: iobroker_poll (iobroker.c:364) ==540== by 0x430B30: event_execution_loop (events.c:1062) ==540== by 0x414D53: main (naemon.c:768) ==540== ==540== 10 bytes in 1 blocks are definitely lost in loss record 24 of 349 ==540== at 0x4C279EE: malloc (vg_replace_malloc.c:270) ==540== by 0x5338171: strdup (strdup.c:43) ==540== by 0x422437: process_host_command (commands.c:1441) ==540== by 0x422EAE: process_external_command1 (commands.c:886) ==540== by 0x446032: qh_command (query-handler.c:351) ==540== by 0x446315: qh_input (query-handler.c:193) ==540== by 0x473455: iobroker_poll (iobroker.c:364) ==540== by 0x430B30: event_execution_loop (events.c:1062) ==540== by 0x414D53: main (naemon.c:768)

catharsis commented 10 years ago

For the record, this is implicitly fixed by #40. We should keep this issue open, though, until the future of that patch is decided.

pengi commented 10 years ago

Seems fixed by #40, so I'll closed this one now.

==31904== LEAK SUMMARY: ==31904== definitely lost: 0 bytes in 0 blocks ==31904== indirectly lost: 0 bytes in 0 blocks ==31904== possibly lost: 0 bytes in 0 blocks ==31904== still reachable: 4,514,234 bytes in 1,504 blocks ==31904== suppressed: 0 bytes in 0 blocks