diff --git a/bind-9.5-dbus-leak.patch b/bind-9.5-dbus-leak.patch new file mode 100644 index 0000000..0407cf6 --- /dev/null +++ b/bind-9.5-dbus-leak.patch @@ -0,0 +1,63 @@ +Written-by: Adam Tkac + +diff -up bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak bind-9.5.0a6/contrib/dbus/dbus_mgr.c +--- bind-9.5.0a6/contrib/dbus/dbus_mgr.c.leak 2007-05-10 07:47:02.000000000 +0200 ++++ bind-9.5.0a6/contrib/dbus/dbus_mgr.c 2007-10-18 13:32:19.000000000 +0200 +@@ -167,6 +167,9 @@ dbus_mgr_init_dbus(ns_dbus_mgr_t *); + static isc_result_t + dbus_mgr_record_initial_fwdtable(ns_dbus_mgr_t *); + ++static ++dns_fwdtable_t *dbus_mgr_get_fwdtable(void); ++ + static void + dbus_mgr_free_initial_fwdtable(ns_dbus_mgr_t *); + +@@ -272,6 +275,8 @@ dbus_mgr_create + return ISC_R_SUCCESS; + + cleanup_mgr: ++ if ( dbus_mgr_get_fwdtable() != NULL) ++ dbus_mgr_free_initial_fwdtable (mgr); + if( mgr->task != 0L ) + isc_task_detach(&(mgr->task)); + isc_mem_put(mctx, mgr, sizeof(*mgr)); +@@ -623,7 +628,7 @@ static void dbus_mgr_record_initial_forw + + dns_name_init(&(ifwdr->dn), NULL); + if( dns_name_dupwithoffsets(name, mgr->mctx, &(ifwdr->dn)) != ISC_R_SUCCESS ) +- return; ++ goto namedup_err; + + ISC_LIST_INIT(ifwdr->sa); + +@@ -634,14 +639,27 @@ static void dbus_mgr_record_initial_forw + { + nsa = isc_mem_get(mgr->mctx, sizeof(isc_sockaddr_t)); + if( nsa == 0L ) +- return; ++ goto nsa_err; + *nsa = *sa; + ISC_LINK_INIT(nsa, link); + ISC_LIST_APPEND(ifwdr->sa, nsa, link); + } + ISC_LINK_INIT(ifwdr, link); + tsearch( ifwdr, &(mgr->ifwdt), dbus_mgr_ifwdr_comparator); +-} ++ ++ return; ++ ++nsa_err: ++ while ( (sa = ISC_LIST_HEAD (ifwdr->sa)) != NULL) { ++ ISC_LIST_UNLINK (ifwdr->sa, sa, link); ++ isc_mem_put (mgr->mctx, sa, sizeof (*sa)); ++ } ++ ++namedup_err: ++ isc_mem_put (mgr->mctx, ifwdr, sizeof (*ifwdr)); ++ ++ return; ++} + + static isc_result_t + dbus_mgr_record_initial_fwdtable( ns_dbus_mgr_t *mgr ) diff --git a/bind-9.5-dbus-va_end.patch b/bind-9.5-dbus-va_end.patch new file mode 100644 index 0000000..54b3ee6 --- /dev/null +++ b/bind-9.5-dbus-va_end.patch @@ -0,0 +1,29 @@ +Written-by: Peter Jones +Reviewed-by: Adam Tkac + +--- bind-9.5.0a6/contrib/dbus/dbus_service.c.va_end 2007-10-17 14:55:10.000000000 -0400 ++++ bind-9.5.0a6/contrib/dbus/dbus_service.c 2007-10-17 14:56:20.000000000 -0400 +@@ -200,6 +200,7 @@ dbus_svc_add_filter + } + } + } ++ va_end(va); + return( 1 ); + } + +@@ -424,6 +425,7 @@ dbus_svc_message_append_args(DBusConnect + if( !dbus_message_append_args_valist( msg, firstType, va ) ) + { + if( cs->eh != 0L ) (*(cs->eh))("dbus_svc_send: dbus_message_append_args failed"); ++ va_end(va); + return 0; + } + va_end(va); +@@ -488,6 +490,7 @@ dbus_svc_call + va_end(va); + return(0L); + } ++ va_end(va); + return reply; + } + diff --git a/bind.spec b/bind.spec index eb6aaed..fe92171 100644 --- a/bind.spec +++ b/bind.spec @@ -21,7 +21,7 @@ Summary: The Berkeley Internet Name Domain (BIND) DNS (Domain Name System) serv Name: bind License: ISC Version: 9.5.0 -Release: 15.%{RELEASEVER}%{?dist} +Release: 15.1.%{RELEASEVER}%{?dist} Epoch: 32 Url: http://www.isc.org/products/BIND/ Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) @@ -79,6 +79,8 @@ Patch17: bind-9.3.2b1-fix_sdb_ldap.patch # D-BUS patches Patch15: bind-9.5.0-dbus.patch Patch23: bind-9.5-dbus_archdep_libdir.patch +Patch81: bind-9.5-dbus-leak.patch +Patch82: bind-9.5-dbus-va_end.patch # IDN paches Patch73: bind-9.5-libidn.patch @@ -221,6 +223,8 @@ cp -fp contrib/sdb/sqlite/zone2sqlite.c bin/sdb_tools %if %{WITH_DBUS} %patch15 -p1 -b .dbus %patch23 -p1 -b .dbus_archdep_libdir +%patch81 -p1 -b .leak +%patch82 -p1 -b .va_end %endif %if %{SDB} %patch17 -p1 -b .fix_sdb_ldap @@ -402,7 +406,7 @@ for f in my.internal.zone.db slaves/my.slave.internal.zone.db slaves/my.ddns.int echo '@ in soa localhost. root 1 3H 15M 1W 1D ns localhost.' > sample/var/named/$f; done -/usr/bin/tail -n '+'`/bin/egrep -n '\\$Id: bind.spec,v 1.219 2007/10/16 16:41:25 atkac Exp $/+1/' | bc` bin/rndc/rndc.conf | sed '/Sample rndc configuration file./{p;i\ +/usr/bin/tail -n '+'`/bin/egrep -n '\\$Id: bind.spec,v 1.220 2007/10/18 17:45:07 atkac Exp $/+1/' | bc` bin/rndc/rndc.conf | sed '/Sample rndc configuration file./{p;i\ *\ * NOTE: you only need to create this file if it is to\ * differ from the following default contents: @@ -645,6 +649,10 @@ rm -rf ${RPM_BUILD_ROOT} %{_sbindir}/bind-chroot-admin %changelog +* Wed Oct 18 2007 Adam Tkac 32:9.5.0-15.1.a6 +- fixed missing va_end () functions (#336601) +- fixed memory leak when dbus initialization fails + * Tue Oct 16 2007 Adam Tkac 32:9.5.0-15.a6 - corrected named.5 SDB statement (#326051)