r24165: Fix Coverity ID 369.
authorVolker Lendecke <vlendec@samba.org>
Sat, 4 Aug 2007 10:18:33 +0000 (10:18 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:29:17 +0000 (12:29 -0500)
This was not really a bug I think, but this change cleans up the code a
bit.

source/rpc_server/srv_lsa_nt.c

index 1f9c245723eb99dcb4601cd5eceadb222d43b317..40d5005c4f7b424f7e5e86f420801b3489555071 100644 (file)
@@ -1517,16 +1517,16 @@ NTSTATUS _lsa_enum_accounts(pipes_struct *p, LSA_Q_ENUM_ACCOUNTS *q_u, LSA_R_ENU
                        SAFE_FREE(sid_list);
                        return NT_STATUS_NO_MEMORY;
                }
+
+               for (i = q_u->enum_context, j = 0; i < num_entries; i++, j++) {
+                       init_dom_sid2(&(*sids).sid[j], &sid_list[i]);
+                       (*sids).ptr_sid[j] = 1;
+               }
        } else {
                sids->ptr_sid = NULL;
                sids->sid = NULL;
        }
 
-       for (i = q_u->enum_context, j = 0; i < num_entries; i++, j++) {
-               init_dom_sid2(&(*sids).sid[j], &sid_list[i]);
-               (*sids).ptr_sid[j] = 1;
-       }
-
        talloc_free(sid_list);
 
        init_lsa_r_enum_accounts(r_u, num_entries);