Memory leak due to memory allocated in "init_snmp_enum"(snmp_enum.c)

"Rohit Sabhlok" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
Hi

  I am using the netsnmp library for making snmp request to a snmp agent. I am getting a memory leak.

The memory for which leak is coming is allocated in the fc "init_snmp_enum" in the file "snmp_enum.c". At the start of my application, I call the fc 
"void init_snmp(const char *type)". This in turn calls the fc "init_snmp_enum". 

In the fc "init_snmp_enum" memory is allocated for "snmp_enum_lists" and for "snmp_enum_lists[i]" for i=0..(SE_MAX_IDS-1)

Here we have "snmp_enum_list" declared as
static struct snmp_enum_list ***snmp_enum_lists;

When my application is shutting down I call the following fcs to free the memory.
-snmp_shutdown("snmpapp");
-netsnmp_container_free_list();
-clear_sec_mod();
-clear_snmp_enum();
-clear_callback();
-netsnmp_clear_tdomain_list();

But the memory allocated in fc "init_snmp_enum" is not freed. I was using Rational Purify, where it showed the memory leak location.

I could not find a fc which to call to free the memory allocated in "snmp_enum_list".

It would be very nice if you could see if I am doing something wrong. I very much appreciate your help.

Thanks and Regards
Rohit Sabhlok
  

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-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.