X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fdaemon%2Fplugin.c;h=3da8eccbb3b2b147f8042c866ded54ee788fe127;hb=dab48f284f9d4bb6ae98244310c5cdb6c5d91bf3;hp=3d364458bfb4c3a3e0def36300e9a76d23cf88ee;hpb=cf33da9ad00ac94931a2c87563f8d007a996f1ad;p=collectd.git diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c index 3d364458..3da8eccb 100644 --- a/src/daemon/plugin.c +++ b/src/daemon/plugin.c @@ -235,13 +235,13 @@ static void destroy_read_heap (void) /* {{{ */ while (42) { - callback_func_t *cf; + read_func_t *rf; - cf = c_heap_get_root (read_heap); - if (cf == NULL) + rf = c_heap_get_root (read_heap); + if (rf == NULL) break; - - destroy_callback (cf); + sfree (rf->rf_name); + destroy_callback ((callback_func_t *) rf); } c_heap_destroy (read_heap); @@ -1237,8 +1237,10 @@ int plugin_register_read (const char *name, rf->rf_interval = plugin_get_interval (); status = plugin_insert_read (rf); - if (status != 0) + if (status != 0) { + sfree (rf->rf_name); sfree (rf); + } return (status); } /* int plugin_register_read */ @@ -1285,8 +1287,10 @@ int plugin_register_complex_read (const char *group, const char *name, rf->rf_ctx = plugin_get_ctx (); status = plugin_insert_read (rf); - if (status != 0) + if (status != 0) { + sfree (rf->rf_name); sfree (rf); + } return (status); } /* int plugin_register_complex_read */ @@ -1720,6 +1724,7 @@ int plugin_read_all_once (void) return_status = -1; } + sfree (rf->rf_name); destroy_callback ((void *) rf); }