summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2008-05-27 13:56:55 -0700
committerJeremy Allison <jra@samba.org>2008-05-27 13:56:55 -0700
commit5e4d4c8ace62c2a9eaf03f6b2fff0c4598e01d37 (patch)
tree73717b8b6dc7649a1a479030722a58b140396a03 /source3/utils
parentd5d4a9511d763cc4a63d3020c5537e852da2ed4c (diff)
downloadsamba-5e4d4c8ace62c2a9eaf03f6b2fff0c4598e01d37.tar.gz
samba-5e4d4c8ace62c2a9eaf03f6b2fff0c4598e01d37.tar.bz2
samba-5e4d4c8ace62c2a9eaf03f6b2fff0c4598e01d37.zip
A few cleanups from Chere Zhou <chere.zhou@isilon.com>.
Jeremy. Conflicts: source/utils/net_rap.c source/utils/net_rpc.c (This used to be commit ac0c2fb6e8c3d1b14a6e7490857a414a5fac6bb5)
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_rap.c2
-rw-r--r--source3/utils/net_rpc.c5
2 files changed, 7 insertions, 0 deletions
diff --git a/source3/utils/net_rap.c b/source3/utils/net_rap.c
index f50b579ac2..449bec6744 100644
--- a/source3/utils/net_rap.c
+++ b/source3/utils/net_rap.c
@@ -221,6 +221,7 @@ static int rap_share_add(struct net_context *c, int argc, const char **argv)
p = strchr(sharename, '=');
if (p == NULL) {
d_printf("Server path not specified\n");
+ SAFE_FREE(sharename);
return net_rap_share_usage(c, argc, argv);
}
*p = 0;
@@ -237,6 +238,7 @@ static int rap_share_add(struct net_context *c, int argc, const char **argv)
ret = cli_NetShareAdd(cli, &sinfo);
cli_shutdown(cli);
+ SAFE_FREE(sharename);
return ret;
}
diff --git a/source3/utils/net_rpc.c b/source3/utils/net_rpc.c
index 3779611d01..d6a3e486fb 100644
--- a/source3/utils/net_rpc.c
+++ b/source3/utils/net_rpc.c
@@ -3732,6 +3732,10 @@ static NTSTATUS rpc_share_migrate_files_internals(struct net_context *c,
char *dst = NULL;
dst = SMB_STRDUP(c->opt_destination?c->opt_destination:"127.0.0.1");
+ if (dst == NULL) {
+ nt_status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
result = get_share_info(c, pipe_hnd, mem_ctx, level, argc, argv,
&ctr_src);
@@ -3817,6 +3821,7 @@ done:
if (got_dst_share)
cli_shutdown(cp_clistate.cli_share_dst);
+ SAFE_FREE(dst);
return nt_status;
}