diff options
Diffstat (limited to 'source3/utils')
-rw-r--r-- | source3/utils/net_rap.c | 2 | ||||
-rw-r--r-- | source3/utils/net_rpc.c | 5 |
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; } |