Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21515)
(cherry picked from commit
bc5d9cc8711e86d5c25b81c58dfae531536e61fc)
* we have added it to the cache so now pull it out again
*/
if (k > 0) {
- X509_STORE_lock(xl->store_ctx);
+ if (!X509_STORE_lock(xl->store_ctx))
+ goto finish;
j = sk_X509_OBJECT_find(xl->store_ctx->objs, &stmp);
tmp = sk_X509_OBJECT_value(xl->store_ctx->objs, j);
X509_STORE_unlock(xl->store_ctx);