]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
A few cleanups from Chere Zhou <chere.zhou@isilon.com>.
authorJeremy Allison <jra@samba.org>
Tue, 27 May 2008 20:56:55 +0000 (13:56 -0700)
committerJeremy Allison <jra@samba.org>
Tue, 27 May 2008 20:56:55 +0000 (13:56 -0700)
Jeremy.

Conflicts:

source/utils/net_rap.c
source/utils/net_rpc.c

source/utils/net_rap.c
source/utils/net_rpc.c

index f50b579ac280ffc6bbd792424a3b6de610ecc616..449bec674488c558b5db7693731f9ca033e1b847 100644 (file)
@@ -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;
 }
 
index 3779611d012ab8706f5d62c79b23f49379cc3a33..d6a3e486fb3ec5cf63d2ed509540070809d73392 100644 (file)
@@ -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;
 
 }