]> 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>
Sat, 27 Oct 2018 16:24:37 +0000 (05:24 +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 c4d21c10e86d9a4995aecef9ebcca06daefa955a..16c299328bdbffd2806166ad6f6e93472e7898d3 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);