From c4f8a4d9a7ab23039a66c72c34fcab33e89b7592 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 28 Nov 2015 23:07:31 +0100 Subject: [PATCH] modbus plugin: fix 2 leaks on error paths --- src/modbus.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/modbus.c b/src/modbus.c index aa69ee10..2cef4aa2 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -864,9 +864,15 @@ static int mb_config_add_host (oconfig_item_t *ci) /* {{{ */ status = cf_util_get_string_buffer (ci, host->host, sizeof (host->host)); if (status != 0) + { + sfree (host); return (status); + } if (host->host[0] == 0) + { + sfree (host); return (EINVAL); + } for (i = 0; i < ci->children_num; i++) { -- 2.30.2