s3-netapi: Fix zeroing policy handles in NetLocalGroupAdd_r().
authorAndreas Schneider <asn@samba.org>
Mon, 10 Dec 2012 12:24:46 +0000 (13:24 +0100)
committerGünther Deschner <gd@samba.org>
Wed, 12 Dec 2012 08:42:32 +0000 (09:42 +0100)
Found by Coverity.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
source3/lib/netapi/localgroup.c

index 816afc230ff9e8e99c52191b1386c12a59a522ed..1a544adecd34e6d549058514a4489e2e2405fbfe 100644 (file)
@@ -159,6 +159,11 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx,
                return WERR_INVALID_PARAM;
        }
 
+       ZERO_STRUCT(connect_handle);
+       ZERO_STRUCT(builtin_handle);
+       ZERO_STRUCT(domain_handle);
+       ZERO_STRUCT(alias_handle);
+
        switch (r->in.level) {
                case 0:
                        info0 = (struct LOCALGROUP_INFO_0 *)r->in.buffer;
@@ -173,11 +178,6 @@ WERROR NetLocalGroupAdd_r(struct libnetapi_ctx *ctx,
                        goto done;
        }
 
-       ZERO_STRUCT(connect_handle);
-       ZERO_STRUCT(builtin_handle);
-       ZERO_STRUCT(domain_handle);
-       ZERO_STRUCT(alias_handle);
-
        werr = libnetapi_open_pipe(ctx, r->in.server_name,
                                   &ndr_table_samr.syntax_id,
                                   &pipe_cli);