diff --git a/crypto/comp/c_zstd.c b/crypto/comp/c_zstd.c index b4667649f3ce0..99175c87040c9 100644 --- a/crypto/comp/c_zstd.c +++ b/crypto/comp/c_zstd.c @@ -367,6 +367,7 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zstd_init) # define LIBZSTD "zstd" # endif + ERR_set_mark(); zstd_dso = DSO_load(NULL, LIBZSTD, NULL, 0); if (zstd_dso != NULL) { p_createCStream = (createCStream_ft)DSO_bind_func(zstd_dso, "ZSTD_createCStream"); @@ -394,8 +395,10 @@ DEFINE_RUN_ONCE_STATIC(ossl_comp_zstd_init) || p_isError == NULL || p_getErrorName == NULL || p_DStreamInSize == NULL || p_CStreamInSize == NULL) { ossl_comp_zstd_cleanup(); + ERR_pop_to_mark(); return 0; } + ERR_clear_last_mark(); # endif return 1; }