From b2f1a29e4348a5bc34a87d72d526e23e421ed9d5 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 28 Sep 2004 05:44:59 +0000 Subject: r2710: continue with the new style of providing a parent context whenever possible to a structure creation routine. This makes for much easier global cleanup. (This used to be commit e14ee428ec357fab76a960387a9820a673786e27) --- source4/libcli/raw/clisocket.c | 4 ++-- source4/libcli/raw/clitree.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'source4/libcli/raw') diff --git a/source4/libcli/raw/clisocket.c b/source4/libcli/raw/clisocket.c index 37188f4e77..14862a39f0 100644 --- a/source4/libcli/raw/clisocket.c +++ b/source4/libcli/raw/clisocket.c @@ -37,11 +37,11 @@ static int sock_destructor(void *ptr) /* create a smbcli_socket context */ -struct smbcli_socket *smbcli_sock_init(void) +struct smbcli_socket *smbcli_sock_init(TALLOC_CTX *mem_ctx) { struct smbcli_socket *sock; - sock = talloc_p(NULL, struct smbcli_socket); + sock = talloc_p(mem_ctx, struct smbcli_socket); if (!sock) { return NULL; } diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index f19cbf8e28..77fe0ebe2f 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -151,7 +151,8 @@ NTSTATUS smb_tree_disconnect(struct smbcli_tree *tree) a convenient function to establish a smbcli_tree from scratch, using reasonable default parameters */ -NTSTATUS smbcli_tree_full_connection(struct smbcli_tree **ret_tree, +NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, + struct smbcli_tree **ret_tree, const char *my_name, const char *dest_host, int port, const char *service, const char *service_type, @@ -172,7 +173,7 @@ NTSTATUS smbcli_tree_full_connection(struct smbcli_tree **ret_tree, *ret_tree = NULL; - sock = smbcli_sock_init(); + sock = smbcli_sock_init(parent_ctx); if (!sock) { return NT_STATUS_NO_MEMORY; } -- cgit