From: Ruben Kerkhof Date: Fri, 4 Dec 2015 18:31:16 +0000 (+0100) Subject: snmp plugin: don't read from uninitialized pointer X-Git-Tag: collectd-5.5.1~7^2~5 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=3a2d7481341d647ca194861dc93d5f309d28e36b;p=collectd.git 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 --- 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;