This is a multi-part message in MIME format.

Content-class: urn:content-classes:message
Content-Type: multipart/alternative;

This is a multi-part message in MIME format.

Content-Type: text/plain;
Content-Transfer-Encoding: quoted-printable

Hello all=20
I've encounter with memory leak and unclose sockets in the snmp agent
-Net-SNMP version 5.3.1:

* for each HUP signal sent to the agent ( for configuration
update) while in the snmpd.conf include trap directive (
v1 or v2 ). for example "trap2sink ggg" there are two
problems :there is memory leak in the agent and new sockets are opened
for each HUP signal. I've succeeded to eliminate opening of the sockets
by simply not register the snmpNotifyTable the problem is cause due to
this code - the open sockets are not closed in the callbacks ( when i've
not register the the snmpNotifyTable the else was operated).

add_trap_session(netsnmp_session * ss, int pdutype, int confirm,
int version)
if (snmp_callback_available(SNMP_CALLBACK_APPLICATION ,
* something else wants to handle notification registrations=20
struct agent_add_trap_args args;
DEBUGMSGTL(("trap", "adding callback trap sink\n")); =3D ss;
args.confirm =3D confirm;
(void *) &args);
} else {
* no other support exists, handle it ourselves.=20
struct trap_sink *new_sink;
DEBUGMSGTL(("trap", "adding internal trap sink\n"));
new_sink =3D (struct trap_sink *) malloc(sizeof(*new_sink));
if (new_sink =3D=3D NULL)
return 0;
new_sink->sesp =3D ss;
new_sink->pdutype =3D pdutype;
new_sink->version =3D version;
new_sink->next =3D sinks;
sinks =3D new_sink;
return 1;