From c5594dff03582000ef423007660d6ed38b8907bf Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 23 Apr 2016 11:10:25 +0200 Subject: [PATCH] snmp plugin: initialize res sooner --- src/snmp.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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)) -- 2.30.2