Commit 7e821419 authored by Mark Andrews's avatar Mark Andrews
Browse files

2269. [contrib] dbus memory leaks and missing va_end calls. [RT #17232]

parent c4dc5966
2269. [contrib] dbus memory leaks and missing va_end calls. [RT #17232]
2268. [bug] 0.IN-ADDR.ARPA was missing from the empty zones
list.
......
......@@ -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 )
......
......@@ -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;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment