From f4b349127bdfe233476fe2efba961912f39a5cbd Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 2 Jan 2005 12:55:33 +0000 Subject: r4479: added the function talloc_autofree_context() which returns a talloc context that will automatically be freed on program exit. This is useful for reducing clutter in leak reports (This used to be commit cf73dda652e0a121901f22771104be6751c0fcb9) --- source4/lib/dcom/common/tables.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'source4/lib/dcom/common/tables.c') diff --git a/source4/lib/dcom/common/tables.c b/source4/lib/dcom/common/tables.c index 6b0d99cae3..faf67710e0 100644 --- a/source4/lib/dcom/common/tables.c +++ b/source4/lib/dcom/common/tables.c @@ -76,10 +76,13 @@ const void *dcom_proxy_vtable_by_iid(const struct GUID *iid) NTSTATUS dcom_register_interface(const void *_iface) { const struct dcom_interface *iface = _iface; - struct interface_list *l = talloc_zero_p(interfaces, struct interface_list); + struct interface_list *l; + + l = talloc_zero_p(interfaces?interfaces:talloc_autofree_context(), + struct interface_list); l->interface = *iface; - + DLIST_ADD(interfaces, l); return NT_STATUS_OK; @@ -88,7 +91,8 @@ NTSTATUS dcom_register_interface(const void *_iface) NTSTATUS dcom_register_class(const void *_class) { const struct dcom_class *class = _class; - struct class_list *l = talloc_zero_p(classes, struct class_list); + struct class_list *l = talloc_zero_p(classes?classes:talloc_autofree_context(), + struct class_list); l->class = *class; -- cgit