]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
Tiny logic simplification -- remove an else branch
authorVolker Lendecke <vl@samba.org>
Thu, 3 Jul 2008 21:34:28 +0000 (23:34 +0200)
committerVolker Lendecke <vl@samba.org>
Sat, 5 Jul 2008 10:19:13 +0000 (12:19 +0200)
source/winbindd/winbindd_idmap.c

index 98f8548083dd2e19cce7b2c6e77bf9b2b87c978c..631f5c1ab48676d90b7877f61d193761cb32f495 100644 (file)
@@ -241,33 +241,31 @@ enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain,
 
        result = idmap_sids_to_unixids(ids, num);
 
-       if (NT_STATUS_IS_OK(result)) {
-
-               xids = SMB_MALLOC_ARRAY(struct unixid, num);
-               if ( ! xids) {
-                       DEBUG(0, ("Out of memory!\n"));
-                       talloc_free(ids);
-                       return WINBINDD_ERROR;
-               }
-
-               for (i = 0; i < num; i++) {
-                       if (ids[i]->status == ID_MAPPED) {
-                               xids[i].type = ids[i]->xid.type;
-                               xids[i].id = ids[i]->xid.id;
-                       } else {
-                               xids[i].type = -1;
-                       }
-               }
-
-               state->response.length = sizeof(state->response) + (sizeof(struct unixid) * num);
-               state->response.extra_data.data = xids;
+       if (!NT_STATUS_IS_OK(result)) {
+               DEBUG (2, ("idmap_sids_to_unixids returned an error: 0x%08x\n",
+                          NT_STATUS_V(result)));
+               talloc_free(ids);
+               return WINBINDD_ERROR;
+       }
 
-       } else {
-               DEBUG (2, ("idmap_sids_to_unixids returned an error: 0x%08x\n", NT_STATUS_V(result)));
+       xids = SMB_MALLOC_ARRAY(struct unixid, num);
+       if ( ! xids) {
+               DEBUG(0, ("Out of memory!\n"));
                talloc_free(ids);
                return WINBINDD_ERROR;
        }
 
+       for (i = 0; i < num; i++) {
+               if (ids[i]->status == ID_MAPPED) {
+                       xids[i].type = ids[i]->xid.type;
+                       xids[i].id = ids[i]->xid.id;
+               } else {
+                       xids[i].type = -1;
+               }
+       }
+
+       state->response.length = sizeof(state->response) + (sizeof(struct unixid) * num);
+       state->response.extra_data.data = xids;
        talloc_free(ids);
        return WINBINDD_OK;
 }