From 38807f046bd94dc573922630cb49d247daa4c578 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 Oct 2004 05:17:21 +0000 Subject: r2906: fixed a memory leak in the smbclient -L code (This used to be commit 0181fe06b4736661871515a7e2ab0d67bc8568fe) --- source4/client/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source4/client') diff --git a/source4/client/client.c b/source4/client/client.c index 9a70c2e09f..823be51285 100644 --- a/source4/client/client.c +++ b/source4/client/client.c @@ -2229,6 +2229,7 @@ static BOOL browse_host(const char *query_host) talloc_destroy(mem_ctx); return False; } + talloc_steal(mem_ctx, p); r.in.server_unc = talloc_asprintf(mem_ctx,"\\\\%s",dcerpc_server_name(p)); r.in.level = 1; @@ -2252,10 +2253,11 @@ static BOOL browse_host(const char *query_host) } } while (NT_STATUS_IS_OK(status) && W_ERROR_EQUAL(r.out.result, WERR_MORE_DATA)); + talloc_destroy(mem_ctx); + if (!NT_STATUS_IS_OK(status) || !W_ERROR_IS_OK(r.out.result)) { d_printf("Failed NetShareEnumAll %s - %s/%s\n", binding, nt_errstr(status), win_errstr(r.out.result)); - talloc_destroy(mem_ctx); return False; } -- cgit