From 3a2d7481341d647ca194861dc93d5f309d28e36b Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Fri, 4 Dec 2015 19:31:16 +0100 Subject: [PATCH] snmp plugin: don't read from uninitialized pointer if the first snmp_pdu_create inside the loop returns an error, we exit the loop with res uninitialized and then call snmp_free_pdu on it. CID #38037 --- src/snmp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/snmp.c b/src/snmp.c index 6ecdfafb..7caa625e 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1194,7 +1194,7 @@ static int csnmp_dispatch_table (host_definition_t *host, data_definition_t *dat static int csnmp_read_table (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; -- 2.30.2