From 83c2f028d81a6b481ecd439494dd7c52b1e1b1ff Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Fri, 13 Feb 2009 10:11:57 +0100 Subject: Fix Coverity ID 742 (RESOURCE_LEAK) --- source3/utils/net_rpc_join.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_rpc_join.c b/source3/utils/net_rpc_join.c index 0c363d373e..1c45d0c515 100644 --- a/source3/utils/net_rpc_join.c +++ b/source3/utils/net_rpc_join.c @@ -481,7 +481,6 @@ done: **/ int net_rpc_testjoin(struct net_context *c, int argc, const char **argv) { - char *domain = smb_xstrdup(c->opt_target_workgroup); NTSTATUS nt_status; if (c->display_usage) { @@ -492,15 +491,13 @@ int net_rpc_testjoin(struct net_context *c, int argc, const char **argv) } /* Display success or failure */ - nt_status = net_rpc_join_ok(c, domain, NULL, NULL); + nt_status = net_rpc_join_ok(c, c->opt_target_workgroup, NULL, NULL); if (!NT_STATUS_IS_OK(nt_status)) { fprintf(stderr,"Join to domain '%s' is not valid: %s\n", - domain, nt_errstr(nt_status)); - free(domain); + c->opt_target_workgroup, nt_errstr(nt_status)); return -1; } - printf("Join to '%s' is OK\n",domain); - free(domain); + printf("Join to '%s' is OK\n", c->opt_target_workgroup); return 0; } -- cgit