summaryrefslogtreecommitdiff
path: root/source4/client
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2004-10-11 05:17:21 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:59:46 -0500
commit38807f046bd94dc573922630cb49d247daa4c578 (patch)
treee564d825fec160b0e326f24e461f0d721cae7b86 /source4/client
parentaf3866903e009271533f91470fe7d8819516b09e (diff)
downloadsamba-38807f046bd94dc573922630cb49d247daa4c578.tar.gz
samba-38807f046bd94dc573922630cb49d247daa4c578.tar.bz2
samba-38807f046bd94dc573922630cb49d247daa4c578.zip
r2906: fixed a memory leak in the smbclient -L code
(This used to be commit 0181fe06b4736661871515a7e2ab0d67bc8568fe)
Diffstat (limited to 'source4/client')
-rw-r--r--source4/client/client.c4
1 files changed, 3 insertions, 1 deletions
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;
}