From: Ruben Kerkhof Date: Sat, 23 Apr 2016 09:10:25 +0000 (+0200) Subject: snmp plugin: initialize res sooner X-Git-Tag: collectd-5.6.0~329^2~25 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c5594dff03582000ef423007660d6ed38b8907bf;p=collectd.git snmp plugin: initialize res sooner --- diff --git a/src/snmp.c b/src/snmp.c index 31beee05..4f4be126 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1673,7 +1673,7 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) static int csnmp_read_value (host_definition_t *host, data_definition_t *data) { struct snmp_pdu *req; - struct snmp_pdu *res; + struct snmp_pdu *res = NULL; struct variable_list *vb; const data_set_t *ds; @@ -1735,7 +1735,6 @@ static int csnmp_read_value (host_definition_t *host, data_definition_t *data) for (i = 0; i < data->values_len; i++) snmp_add_null_var (req, data->values[i].oid, data->values[i].oid_len); - res = NULL; status = snmp_sess_synch_response (host->sess_handle, req, &res); if ((status != STAT_SUCCESS) || (res == NULL))