[collectd] Memory leaks

Niraj Tolia ntolia at gmail.com
Thu Oct 9 23:20:45 CEST 2008

While on the topic, here are a couple of other leaks:

==30675==    at 0x4C22FAB: malloc (vg_replace_malloc.c:207)
==30675==    by 0x52C1DD1: strdup (in /lib/libc-2.7.so)
==30675==    by 0x40AC00: uc_update (utils_cache.c:179)
==30675==    by 0x4089F8: plugin_dispatch_values (plugin.c:789)
==30675==    by 0x5DAF1C2: lv_read (libvirt.c:761)
==30675==    by 0x408CE3: plugin_read_thread (plugin.c:201)
==30675==    by 0x4E2D3F6: start_thread (in /lib/libpthread-2.7.so)
==30675==    by 0x531EB2C: clone (in /lib/libc-2.7.so)

My guess is that you don't free 'key' after the call to c_avl_remote()
in uc_check_timeout() in utils_cache.c. Would this be correct?

==30675== 1,934 (480 direct, 1,454 indirect) bytes in 1 blocks are
definitely lost in loss record 34 of 63
==30675==    at 0x4C22FAB: malloc (vg_replace_malloc.c:207)
==30675==    by 0x4C230F4: realloc (vg_replace_malloc.c:429)
==30675==    by 0x407497: cf_ci_append_children (configfile.c:429)
==30675==    by 0x4078DA: cf_read_generic (configfile.c:690)
==30675==    by 0x407ECD: cf_read (configfile.c:875)
==30675==    by 0x405A25: main (collectd.c:450)

Not 100% sure on how to fix this one as I don't understand that code too well.


More information about the collectd mailing list