From: Ruben Kerkhof Date: Sat, 23 Apr 2016 09:07:38 +0000 (+0200) Subject: snmp plugin: res can't be NULL here X-Git-Tag: collectd-5.6.0~329^2~27 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=d0540d2ebaead6661de0ef29c0435c046c7ff4f7;p=collectd.git 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. --- 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);