Code

snmp plugin: plug leak in error path.
authorRuben Kerkhof <ruben@rubenkerkhof.com>
Fri, 27 Nov 2015 21:14:08 +0000 (22:14 +0100)
committerFlorian Forster <octo@collectd.org>
Sat, 28 Nov 2015 06:50:45 +0000 (07:50 +0100)
Partial back port of #1368.

Signed-off-by: Florian Forster <octo@collectd.org>
src/snmp.c

index 33a76e33f01bfb767c4d7bcf285759bb033401b9..3d6604183ea1cbcb626262149a66d241ba3d9f17 100644 (file)
@@ -656,7 +656,10 @@ static int csnmp_config_add_host (oconfig_item_t *ci)
 
   status = cf_util_get_string(ci, &hd->name);
   if (status != 0)
+  {
+    sfree (hd);
     return status;
+  }
 
   hd->sess_handle = NULL;
   hd->interval = 0;