]> 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>
Wed, 24 Oct 2018 12:12:01 +0000 (01:12 +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 29aa0c28d3a86a788126f0f326ac8045824e80dc..9141081e9899347726dcc48572590a9dd0cf76c7 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);