X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fsnmp.c;h=7d340d18c2398a8a26fb845d7b0e03352b53f903;hb=51a4e62d7d0e73d8d5822efaef1e3218b5ad0373;hp=b90e0ffa69269f4ad67df7874423989521d7cb60;hpb=e767dc103a142e1c57800f06a9c384f21a48aef5;p=collectd.git diff --git a/src/snmp.c b/src/snmp.c index b90e0ffa..7d340d18 100644 --- a/src/snmp.c +++ b/src/snmp.c @@ -1316,6 +1316,8 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) snmp_free_pdu (res); res = NULL; + /* snmp_synch_response already freed our PDU */ + req = NULL; sfree (errstr); csnmp_host_close_session (host); @@ -1437,9 +1439,8 @@ static int csnmp_read_table (host_definition_t *host, data_definition_t *data) snmp_free_pdu (res); res = NULL; - /* - * memory is handled by snmp_synch_response - */ + if (req != NULL) + snmp_free_pdu (req); req = NULL; if (status == 0)