From b157e863b19a5733919809f1bb860e5f316453c1 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 4 Jul 2015 19:56:20 +0200 Subject: [PATCH] plugin.c: plug leak on error --- src/plugin.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 */ -- 2.30.2