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.6.0~527^2 X-Git-Url: https://git.octo.it/?a=commitdiff_plain;h=3c3ab1b4489e03ed2344014f7f99e88a7fffbc69;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 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;