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.6.0~557^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c3c970f2a8e538cea762d8ab2617010f1154001c;p=collectd.git modbus plugin: fix 2 leaks on error paths --- diff --git a/src/modbus.c b/src/modbus.c index cfc6331e..d2b0a535 100644 --- a/src/modbus.c +++ b/src/modbus.c @@ -942,9 +942,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++) {