From: Ruben Kerkhof Date: Sat, 4 Jul 2015 17:56:20 +0000 (+0200) Subject: plugin.c: plug leak on error X-Git-Tag: collectd-5.5.1~68^2~12 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=b157e863b19a5733919809f1bb860e5f316453c1;p=collectd.git plugin.c: plug leak on error --- diff --git a/src/plugin.c b/src/plugin.c index cb1005e8..8dfb2c28 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1133,8 +1133,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 */ @@ -1181,8 +1183,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 */