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/librpc/rpc/dcerpc.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/librpc/rpc') diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c index f6c0ebc413..e329297ab6 100644 --- a/source4/librpc/rpc/dcerpc.c +++ b/source4/librpc/rpc/dcerpc.c @@ -27,21 +27,22 @@ struct dcerpc_interface_list *dcerpc_pipes = NULL; -NTSTATUS librpc_register_interface (const struct dcerpc_interface_table *interface) +NTSTATUS librpc_register_interface(const struct dcerpc_interface_table *interface) { - struct dcerpc_interface_list *l = talloc_p(NULL, struct dcerpc_interface_list); + struct dcerpc_interface_list *l = talloc_p(talloc_autofree_context(), + struct dcerpc_interface_list); if (idl_iface_by_name (interface->name) != NULL) { DEBUG(0, ("Attempt to register interface %s twice\n", interface->name)); return NT_STATUS_OBJECT_NAME_COLLISION; } l->table = interface; - + DLIST_ADD(dcerpc_pipes, l); return NT_STATUS_OK; } - + /* initialise a dcerpc pipe. */ struct dcerpc_pipe *dcerpc_pipe_init(void) { -- cgit