From 827cbb480c6de7471554c97cb4cef13e5db7b2b3 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 2 Nov 2005 03:08:52 +0000 Subject: r11466: Clear up some memory leaks in smbclient. Andrew Bartlett (This used to be commit 6535959fd7dfddd6bafb77a266ec3a641025f880) --- source4/libcli/raw/clitree.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source4/libcli/raw') diff --git a/source4/libcli/raw/clitree.c b/source4/libcli/raw/clitree.c index 990552d64f..96d36c569c 100644 --- a/source4/libcli/raw/clitree.c +++ b/source4/libcli/raw/clitree.c @@ -172,10 +172,14 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, { struct smb_composite_connect io; NTSTATUS status; + TALLOC_CTX *tmp_ctx = talloc_new(parent_ctx); + if (!tmp_ctx) { + return NT_STATUS_NO_MEMORY; + } io.in.dest_host = dest_host; io.in.port = port; - io.in.called_name = strupper_talloc(parent_ctx, dest_host); + io.in.called_name = strupper_talloc(tmp_ctx, dest_host); io.in.service = service; io.in.service_type = service_type; io.in.credentials = credentials; @@ -186,6 +190,6 @@ NTSTATUS smbcli_tree_full_connection(TALLOC_CTX *parent_ctx, if (NT_STATUS_IS_OK(status)) { *ret_tree = io.out.tree; } - + talloc_free(tmp_ctx); return status; } -- cgit