Fixes Coverity
1539148
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21755)
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.