]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix memory leak when parsing SNMP packet (#313)
authorflozilla <fishyflow@gmail.com>
Wed, 24 Oct 2018 12:12:01 +0000 (14:12 +0200)
committerAmos Jeffries <yadij@users.noreply.github.com>
Fri, 26 Oct 2018 12:50:17 +0000 (01:50 +1300)
SNMP queries denied by snmp_access rules and queries with certain
unsupported SNMPv2 commands were leaking a few hundred bytes each. Such
queries trigger "SNMP agent query DENIED from..." WARNINGs in cache.log.

src/snmp_core.cc

index ad83935e83a5dd6fd953ffd965bd84eadc9c4e8f..281da513abfefaba2752d189e27f968ea5b2bb65 100644 (file)
@@ -409,6 +409,7 @@ snmpDecodePacket(SnmpRequest * rq)
             snmpConstructReponse(rq);
         } else {
             debugs(49, DBG_IMPORTANT, "WARNING: SNMP agent query DENIED from : " << rq->from);
+            snmp_free_pdu(PDU);
         }
         xfree(Community);