From ac0c2fb6e8c3d1b14a6e7490857a414a5fac6bb5 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 27 May 2008 13:56:55 -0700 Subject: [PATCH] A few cleanups from Chere Zhou . Jeremy. Conflicts: source/utils/net_rap.c source/utils/net_rpc.c --- source/utils/net_rap.c | 2 ++ source/utils/net_rpc.c | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/source/utils/net_rap.c b/source/utils/net_rap.c index f50b579ac28..449bec67448 100644 --- a/source/utils/net_rap.c +++ b/source/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/source/utils/net_rpc.c b/source/utils/net_rpc.c index 3779611d012..d6a3e486fb3 100644 --- a/source/utils/net_rpc.c +++ b/source/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; } -- 2.11.4.GIT