From: Ruben Kerkhof Date: Sat, 28 Nov 2015 22:07:31 +0000 (+0100) Subject: modbus plugin: fix 2 leaks on error paths X-Git-Tag: collectd-5.5.1~40^2~1 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=c4f8a4d9a7ab23039a66c72c34fcab33e89b7592;p=collectd.git modbus plugin: fix 2 leaks on error paths --- 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++) {