/*
- * Copyright 1995-2022 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 1995-2023 The OpenSSL Project Authors. All Rights Reserved.
*
* Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
if (!sk_X509_OBJECT_is_sorted(store->objs)) {
X509_STORE_unlock(store);
/* Take a write lock instead of a read lock */
- X509_STORE_lock(store);
+ if (!X509_STORE_lock(store))
+ return 0;
/*
* Another thread might have sorted it in the meantime. But if so,
* sk_X509_OBJECT_sort() exits early.