- fix occasional segfaults when snmpd starts

This commit is contained in:
Radek Vokál 2007-01-23 10:15:41 +00:00
parent 83abd96a90
commit ce6f4e4d9d
2 changed files with 55 additions and 1 deletions

49
net-snmp-5.4-free.patch Normal file
View File

@ -0,0 +1,49 @@
--- 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 */
}

View File

@ -7,7 +7,7 @@
Summary: A collection of SNMP protocol tools and libraries
Name: net-snmp
Version: %{major_ver}
Release: 7%{?dist}
Release: 8%{?dist}
Epoch: 1
License: BSDish
@ -35,6 +35,7 @@ Patch9: net-snmp-5.4-config_libdir.patch
Patch11: net-snmp-5.4-ip-addr-route-leaks.patch
Patch12: net-snmp-5.4-tcpConn-tcp6-fopen.patch
Patch13: net-snmp-5.4-ethtool-config.patch
Patch14: net-snmp-5.4-free.patch
Requires(pre): /sbin/chkconfig
Obsoletes: ucd-snmp
@ -145,6 +146,7 @@ and applications.
%patch12 -p1 -b .tcp6-fopen
%patch13 -p1 -b .ethtool-config
%patch14 -p1 -b .free
# Do this patch with a perl hack...
perl -pi -e "s|'\\\$install_libdir'|'%{_libdir}'|" ltmain.sh
@ -356,6 +358,9 @@ rm -rf ${RPM_BUILD_ROOT}
%{_libdir}/lib*.so.*
%changelog
* Tue Jan 23 2007 Radek Vokál <rvokal@redhat.com> - 5.4-8
- fix occasional segfaults when snmpd starts
* Thu Jan 11 2007 Radek Vokál <rvokal@redhat.com> - 5.4-7
- fix ethtool extension (#222268)