From d0540d2ebaead6661de0ef29c0435c046c7ff4f7 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 23 Apr 2016 11:07:38 +0200 Subject: [PATCH] snmp plugin: res can't be NULL here [src/snmp.c:1761] -> [src/snmp.c:1777]: (warning) Either the condition 'res!=0' is redundant or there is possible null pointer dereference: res. --- src/snmp.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/snmp.c b/src/snmp.c index 8b21907a..0e2af3be 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1774,9 +1774,7 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data) data->scale, data->shift, host->name, data->name); } /* for (res->variables) */ - if (res != NULL) - snmp_free_pdu (res); - res = NULL; + snmp_free_pdu (res); DEBUG ("snmp plugin: -> plugin_dispatch_values (&vl);"); plugin_dispatch_values (&vl); -- 2.11.0