From: Marc Fournier Date: Fri, 8 Aug 2014 13:55:10 +0000 (+0200) Subject: snmp: free snmp_pdu struct allocated by snmp_pdu_create() X-Git-Tag: collectd-5.3.2~53^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0da910fb1bf2bd4982ca6541458c795ec296f398;p=thirdparty%2Fcollectd.git snmp: free snmp_pdu struct allocated by snmp_pdu_create() This should fix the leak reported in issue #610. --- diff --git a/src/snmp.c b/src/snmp.c index d440f7fee..dacdedea5 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1503,6 +1503,10 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) snmp_free_pdu (res); res = NULL; + if (req != NULL) + snmp_free_pdu (req); + req = NULL; + if (status == 0) csnmp_dispatch_table (host, data, instance_list_head, value_list_head);