summaryrefslogtreecommitdiff
path: root/source4/libcli/raw
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-09-28 05:44:59 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:25 -0500
commitb2f1a29e4348a5bc34a87d72d526e23e421ed9d5 (patch)
treec69987090647da615193f1361e03986588ac164d /source4/libcli/raw
parenta675b09e8d45b9298df8f8c82bbaa7b91a793eb5 (diff)
downloadsamba-b2f1a29e4348a5bc34a87d72d526e23e421ed9d5.tar.gz
samba-b2f1a29e4348a5bc34a87d72d526e23e421ed9d5.tar.bz2
samba-b2f1a29e4348a5bc34a87d72d526e23e421ed9d5.zip
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)
Diffstat (limited to 'source4/libcli/raw')
-rw-r--r--source4/libcli/raw/clisocket.c4
-rw-r--r--source4/libcli/raw/clitree.c5
2 files changed, 5 insertions, 4 deletions
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;
}