diff options
author | Volker Lendecke <vl@samba.org> | 2008-07-03 23:34:28 +0200 |
---|---|---|
committer | Volker Lendecke <vl@samba.org> | 2008-07-05 12:19:13 +0200 |
commit | 4dbfa7a211317be2e46657a3bdc040091049a75d (patch) | |
tree | 774528859db22e15a67e0b5bea3193adec49d4fe | |
parent | ca342870639f8720b1becb9b6a5587feafbeec11 (diff) | |
download | samba-4dbfa7a211317be2e46657a3bdc040091049a75d.tar.gz samba-4dbfa7a211317be2e46657a3bdc040091049a75d.tar.bz2 samba-4dbfa7a211317be2e46657a3bdc040091049a75d.zip |
Tiny logic simplification -- remove an else branch
(This used to be commit 01c8c7bbf6163d5c7733db0d8ecbccfe7e4fec7d)
-rw-r--r-- | source3/winbindd/winbindd_idmap.c | 42 |
1 files changed, 20 insertions, 22 deletions
diff --git a/source3/winbindd/winbindd_idmap.c b/source3/winbindd/winbindd_idmap.c index 98f8548083..631f5c1ab4 100644 --- a/source3/winbindd/winbindd_idmap.c +++ b/source3/winbindd/winbindd_idmap.c @@ -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; } |