On Thu, 4 May 2006 17:29:03 +0100 (BST) [EMAIL PROTECTED] wrote:
DCU> Hi All,
DCU> I've been investigating a memory leak using net-snmp 5.2.1.2 and I think
DCU> I've tracked the problem down to the send_trap_to_sess() routine in
DCU> agent_trap.c
DCU>
DCU> If snmp_send() fails, then snmp_sess_perror() is called but the pdu is not
DCU> freed, the call to snmp_free_pdu() is commented out. However, in
DCU> snmp_api.c the comments for snmp_send() state that the caller must call
DCU> snmp_free_pdu() if 0 is returned.
DCU>
DCU> I cannot see any bug reports or patches for this problem.
DCU>
DCU> Why would the snmp_free_pdu() be commented out?
I don't know, but it's been that way since Nov 2003.
DCU> Is this a genuine problem or am I missunderstanding the code?
I have to side with you. The code clones a pdu and passes it to snmp_send(),
which will free it on success. On and error, nobody else knows about the
cloned pdu, so it is a leak.
If you uncomment it, does the leak you are seeing go away?
--
NOTE: messages sent directly to me, instead of the lists, will be deleted
unless they are requests for paid consulting services.
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>
You are lost in a twisty maze of little standards, all different.
-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders