Created attachment 522051 [details]
Description of problem:
Qa found out that if the AgentX subagent disconnects while processing a
request, the request then leaks a bit of memory in the master snmpd (approx 44
bytes per such request).
==8326== at 0x4A04A28: calloc (vg_replace_malloc.c:467)
==8326== by 0x4C33E6A: netsnmp_create_delegated_cache (agent_handler.c:713)
==8326== by 0x4C36BC9: agentx_master_handler (master.c:591)
==8326== by 0x4C3642E: netsnmp_call_handlers (agent_handler.c:440)
==8326== by 0x4C26710: handle_var_requests (snmp_agent.c:2611)
==8326== by 0x4C28395: handle_pdu (snmp_agent.c:3407)
==8326== by 0x4C2A7EF: netsnmp_handle_request (snmp_agent.c:3203)
==8326== by 0x4C2B2A9: handle_snmp_packet (snmp_agent.c:1929)
==8326== by 0x6AD6867: _sess_process_packet (snmp_api.c:5604)
==8326== by 0x6AD71FF: _sess_read (snmp_api.c:6043)
==8326== by 0x6AD8048: snmp_sess_read2 (snmp_api.c:6075)
==8326== by 0x6AD810A: snmp_read2 (snmp_api.c:5667)
I assume the AgentX subagents disconnect very rarely and this memory leak
happens only in very exceptional case, so I left the leak there for now, while
working on it upstream. Please reopen the bug if you'r AgentX disconnects often
so the leak might matter.
valgrind output attached.
related to bug 729738
Technical note added. If any revisions are required, please edit the "Technical Notes" field
accordingly. All revisions will be proofread by the Engineering Content Services team.
In the previous update, we fixed snmpd crashing when an AgentX subagent disconnected in the middle of processing a requests. The fix was imperfect and left a small memory leak. In this update, this memory leak is fixed.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory, and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.