Copyright year updates
[openssl.git] / crypto / x509 / x509_lu.c
index 08b8425bbe40bf519374d40f16741f8f0b146af4..0ca7cb960d4fd9f882c8fbda448f96822d74ed3f 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * 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
@@ -339,7 +339,8 @@ static int ossl_x509_store_ctx_get_by_subject(const X509_STORE_CTX *ctx,
     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.