[prev in list] [next in list] [prev in thread] [next in thread] 

List:       net-snmp-support
Subject:    [ net-snmp-Support Requests-433580 ] Memory Leak using trap api
From:       noreply () sourceforge ! net
Date:       2001-06-18 9:00:36
[Download RAW message or body]

Support Requests item #433580, was updated on 2001-06-15 15:37
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=212694&aid=433580&group_id=12694

Category: None
Group: None
Status: Open
Priority: 5
Submitted By: William Frauenhofer (wfrauenhofer)
Assigned to: Nobody/Anonymous (nobody)
Summary: Memory Leak using trap api

Initial Comment:
On RedHat 6.2 running net-snmp 4.1.2 with an application that calls the 
send_enterprise_trap_vars(SNMP_TRAP_ENTERPRISESPECIFIC, 1, oid, oidlength, snmp) function 
(we externalized the function by making the function declaration in agent_trap.h), we experience 
48 bytes per call memory leak.  
Investigation reveals that this routine calls snmp_set_var_value which mallocs space for the oid.

The circumvention was:

1. create a state variable in send_enterprise_trap_vars (I called it "mallocDone") and set to 0
2. In the switch statement, case SNMP_TRAP_ENTERPRISESPECIFIC, set "mallocDone = 1;" after 
the  call to snmp_set_var_value.
3. Before the return, 
    if ( mallocDone == 1 )

    {

	free(snmptrap_var.val.string);

    }

It seems to work for us.  (Intrusion.com produces SecureNet Pro which has the option of sending 
detected intrusion events as SNMP traps to management consoles.)

R/S,

Bill Frauenhofer
Sr. Software Engineer
Intrusion.com
williamf@intrusion.com


----------------------------------------------------------------------

>Comment By: John Naylon (jbpn)
Date: 2001-06-18 02:00

Message:
Logged In: YES 
user_id=93926

You may wish to upgrade to version 4.2.1, which I am fairly
sure fixes this memory leak amongst several others.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=212694&aid=433580&group_id=12694

_______________________________________________
Net-snmp-support mailing list
Net-snmp-support@lists.sourceforge.net
http://lists.sourceforge.net/lists/listinfo/net-snmp-support

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic