[Sorry for the delay in responding]

On 26/03/07, Jakob Lechner wrote:
> I'm writing a SNMP agent that dynamically registers certain variables.
> ... [using] exactly the same API
> functions as in "watcher.c" example



> I can access the variables using snmpwalk, everything works fine. But
> how can I unregister an variable again and free all the memory that was
> allocated on registration? I tried the API functions
> "netsnmp_unregister_handler"


That would be the correct call, yes.

It is quite possible that there are memory leaks associated with unregistering
MIB modules. This is an area of agent behaviour that doesn't tend to receive
a great deal of attention, since this typically only happens when the agent is
shutting down (so will release the memory anyway).

Which version of the code are you working with? It's always worth trying with
the most recent release (currently 5.4), or the main SVN development code.

If this leak still exists, and you can identify what might be causing it,
please consider submitting a fix to the patch tracker.

Dave

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders