From ce6f4e4d9dc9acd07b153d5c14afa2225fa03c9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Radek=20Vok=C3=A1l?= Date: Tue, 23 Jan 2007 10:15:41 +0000 Subject: [PATCH] - fix occasional segfaults when snmpd starts --- net-snmp-5.4-free.patch | 49 +++++++++++++++++++++++++++++++++++++++++ net-snmp.spec | 7 +++++- 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 net-snmp-5.4-free.patch diff --git a/net-snmp-5.4-free.patch b/net-snmp-5.4-free.patch new file mode 100644 index 0000000..5b4e14f --- /dev/null +++ b/net-snmp-5.4-free.patch @@ -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 */ + } diff --git a/net-snmp.spec b/net-snmp.spec index 354f140..c2d6852 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -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 - 5.4-8 +- fix occasional segfaults when snmpd starts + * Thu Jan 11 2007 Radek Vokál - 5.4-7 - fix ethtool extension (#222268)