summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorLaMont Jones <lamont@debian.org>2008-02-10 12:43:45 -0700
committerLaMont Jones <lamont@debian.org>2008-02-10 12:43:45 -0700
commitabd0f5d555ec9d919c33dd7f65ff8de625fb077a (patch)
treebb08a5a7e9fc09de349dd1230ff1253a5d5490b0 /contrib
parent5f34ba4ead13e0bdcae001a4c4190faa38ca13bc (diff)
downloadbind9-abd0f5d555ec9d919c33dd7f65ff8de625fb077a.tar.gz
9.5.0b2
Diffstat (limited to 'contrib')
-rw-r--r--contrib/dbus/dbus_mgr.c24
-rw-r--r--contrib/dbus/dbus_service.c3
2 files changed, 24 insertions, 3 deletions
diff --git a/contrib/dbus/dbus_mgr.c b/contrib/dbus/dbus_mgr.c
index 71e1eacd..b744790c 100644
--- a/contrib/dbus/dbus_mgr.c
+++ b/contrib/dbus/dbus_mgr.c
@@ -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_forwarder( dns_name_t *name, dns_forwarders_
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_forwarder( dns_name_t *name, dns_forwarders_
{
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/contrib/dbus/dbus_service.c b/contrib/dbus/dbus_service.c
index 0ed903d0..47d55d58 100644
--- a/contrib/dbus/dbus_service.c
+++ b/contrib/dbus/dbus_service.c
@@ -200,6 +200,7 @@ dbus_svc_add_filter
}
}
}
+ va_end(va);
return( 1 );
}
@@ -424,6 +425,7 @@ dbus_svc_message_append_args(DBusConnectionState *cs, dbus_svc_MessageHandle msg
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;
}