r24291: Fix Coverity ID 364
authorVolker Lendecke <vlendec@samba.org>
Thu, 9 Aug 2007 20:54:58 +0000 (20:54 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:25 +0000 (12:29 -0500)
We've checked num_rids != 0 above.
(This used to be commit dab5449f385248ab1fdd60b240ef6ad4a27ba7f2)

source3/rpc_parse/parse_samr.c

index 48844c2f53b8dd8bfe0385e82747c2511fc4c740..90f1a2243ba0e01885176f728eb7af68a0fbb94f 100644 (file)
@@ -4993,18 +4993,10 @@ NTSTATUS init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u,
                r_u->ptr_rids = 1;
                r_u->num_rids2 = num_rids;
 
-               if (num_rids) {
-                       if (!(r_u->rids = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
-                               return NT_STATUS_NO_MEMORY;
-                       if (!(r_u->types = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
-                               return NT_STATUS_NO_MEMORY;
-               } else {
-                       r_u->rids = NULL;
-                       r_u->types = NULL;
-               }
-
-               if (!r_u->rids || !r_u->types)
-                       goto empty;
+               if (!(r_u->rids = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
+                       return NT_STATUS_NO_MEMORY;
+               if (!(r_u->types = TALLOC_ZERO_ARRAY(ctx, uint32, num_rids)))
+                       return NT_STATUS_NO_MEMORY;
 
                for (i = 0; i < num_rids; i++) {
                        r_u->rids[i] = rid[i];
@@ -5012,7 +5004,6 @@ NTSTATUS init_samr_r_lookup_names(TALLOC_CTX *ctx, SAMR_R_LOOKUP_NAMES * r_u,
                }
        } else {
 
-  empty:
                r_u->num_types1 = 0;
                r_u->ptr_types = 0;
                r_u->num_types2 = 0;