From c22aae9cc8d35b414f62c8f9614bf70f03531a20 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 11 Aug 2025 11:26:40 +0200 Subject: [PATCH] save/restore in the OpenSSL 1.0.2 codepath too --- lib/vtls/openssl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 11eeb60e82..c4c2981108 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -3691,9 +3691,17 @@ CURLcode Curl_ssl_setup_x509_store(struct Curl_cfilter *cf, struct Curl_easy *data, SSL_CTX *ssl_ctx) { - X509_STORE *store = SSL_CTX_get_cert_store(ssl_ctx); + CURLcode result; + X509_STORE *store; - return ossl_populate_x509_store(cf, data, store); + ERR_set_mark(); + + store = SSL_CTX_get_cert_store(ssl_ctx); + result = ossl_populate_x509_store(cf, data, store); + + ERR_pop_to_mark(); + + return result; } #endif /* HAVE_SSL_X509_STORE_SHARE */