From: Pavel Rochnyack Date: Tue, 26 Sep 2017 15:30:52 +0000 (+0700) Subject: snmp plugin: Style fix X-Git-Tag: collectd-5.6.3~4 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=a71c3ebcfc6ca265c702117c89f1bb552723d1fa;p=collectd.git snmp plugin: Style fix Issue: #2291 Signed-off-by: Florian Forster --- diff --git a/src/snmp.c b/src/snmp.c index 6e26ad59..68a3381c 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1363,8 +1363,11 @@ static int csnmp_read_table(host_definition_t *host, data_definition_t *data) { } res = NULL; - /* snmp_sess_synch_response always frees our req PDU */ status = snmp_sess_synch_response(host->sess_handle, req, &res); + + /* snmp_sess_synch_response always frees our req PDU */ + req = NULL; + if ((status != STAT_SUCCESS) || (res == NULL)) { char *errstr = NULL;