From: Stefan Metzmacher Date: Thu, 23 Aug 2012 07:03:36 +0000 (+0200) Subject: s3:lib: only loop over the server_ids we need to verify in serverids_exist() X-Git-Tag: samba-4.0.0beta7~41 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=18c6757dbb7ee0e6a4be15b0f2a3fec1f94ba518;p=thirdparty%2Fsamba.git s3:lib: only loop over the server_ids we need to verify in serverids_exist() metze --- diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c index 61860977cf1..3392e83c89a 100644 --- a/source3/lib/serverid.c +++ b/source3/lib/serverid.c @@ -270,6 +270,8 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results) int todo_num = 0; int *remote_idx = NULL; int remote_num = 0; + int *verify_idx = NULL; + int verify_num = 0; int t, idx; bool result = false; struct db_context *db; @@ -296,6 +298,10 @@ bool serverids_exist(const struct server_id *ids, int num_ids, bool *results) if (remote_idx == NULL) { goto fail; } + verify_idx = talloc_array(talloc_tos(), int, num_ids); + if (verify_idx == NULL) { + goto fail; + } for (idx=0; idx