net-snmp/net-snmp-5.4-free.patch
2007-01-23 10:15:41 +00:00

50 lines
1.7 KiB
Diff

--- net-snmp-5.4/agent/mibgroup/agentx/master_admin.c.old 2006-03-09 01:13:18.000000000 +0100
+++ net-snmp-5.4/agent/mibgroup/agentx/master_admin.c 2007-01-23 10:48:49.000000000 +0100
@@ -138,9 +138,7 @@
snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
SNMPD_CALLBACK_REQ_UNREG_SYSOR_SESS,
(void*)session);
- if (session->myvoid != NULL) {
- free(session->myvoid);
- }
+ SNMP_FREE(session->myvoid);
/*
* The following is necessary to avoid locking up the agent when
* a sugagent dies during a set request. We must clean up the
@@ -171,14 +169,9 @@
*prevNext = sp->next;
- if (sp->securityAuthProto != NULL) {
- free(sp->securityAuthProto);
- }
- if (sp->securityName != NULL) {
- free(sp->securityName);
- }
- free(sp);
- sp = NULL;
+ SNMP_FREE(sp->securityAuthProto);
+ SNMP_FREE(sp->securityName);
+ SNMP_FREE(sp);
DEBUGMSGTL(("agentx/master", "closed %08p, %d okay\n",
session, sessid));
@@ -343,7 +336,7 @@
return AGENTX_ERR_INDEX_NONE_AVAILABLE; /* XXX */
} else {
(void) snmp_clone_var(res, vp);
- free(res);
+ SNMP_FREE(res);
}
vp->next_variable = next;
}
@@ -370,7 +363,7 @@
if (res != SNMP_ERR_NOERROR) {
for (vp2 = pdu->variables; vp2 != vp; vp2 = vp2->next_variable) {
rv = register_index(vp2, ALLOCATE_THIS_INDEX, session);
- free(rv);
+ SNMP_FREE(rv);
}
return AGENTX_ERR_INDEX_NOT_ALLOCATED; /* Probably */
}