]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blob - src/patches/collectd/0014-snmp-free-snmp_pdu-struct-allocated-by-snmp_pdu_crea.patch
Merge remote-tracking branch 'mfischer/slang' into next
[people/pmueller/ipfire-2.x.git] / src / patches / collectd / 0014-snmp-free-snmp_pdu-struct-allocated-by-snmp_pdu_crea.patch
1 From 0da910fb1bf2bd4982ca6541458c795ec296f398 Mon Sep 17 00:00:00 2001
2 From: Marc Fournier <marc.fournier@camptocamp.com>
3 Date: Fri, 8 Aug 2014 15:55:10 +0200
4 Subject: [PATCH 14/22] snmp: free snmp_pdu struct allocated by
5 snmp_pdu_create()
6
7 This should fix the leak reported in issue #610.
8 ---
9 src/snmp.c | 4 ++++
10 1 file changed, 4 insertions(+)
11
12 diff --git a/src/snmp.c b/src/snmp.c
13 index d440f7f..dacdede 100644
14 --- a/src/snmp.c
15 +++ b/src/snmp.c
16 @@ -1503,6 +1503,10 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data)
17 snmp_free_pdu (res);
18 res = NULL;
19
20 + if (req != NULL)
21 + snmp_free_pdu (req);
22 + req = NULL;
23 +
24 if (status == 0)
25 csnmp_dispatch_table (host, data, instance_list_head, value_list_head);
26
27 --
28 1.9.3
29