From 3c3ab1b4489e03ed2344014f7f99e88a7fffbc69 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 0717365a..8df7edd4 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1398,7 +1398,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