aboutsummaryrefslogtreecommitdiff
path: root/crypto/engine/eng_table.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/engine/eng_table.c')
-rw-r--r--crypto/engine/eng_table.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/crypto/engine/eng_table.c b/crypto/engine/eng_table.c
index 9dc3144bbfd7..6280965cc026 100644
--- a/crypto/engine/eng_table.c
+++ b/crypto/engine/eng_table.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2001-2023 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2001-2024 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
@@ -215,9 +215,11 @@ ENGINE *ossl_engine_table_select(ENGINE_TABLE **table, int nid,
f, l, nid);
return NULL;
}
- ERR_set_mark();
+
if (!CRYPTO_THREAD_write_lock(global_engine_lock))
- goto end;
+ return NULL;
+
+ ERR_set_mark();
/*
* Check again inside the lock otherwise we could race against cleanup
* operations. But don't worry about a debug printout