mirror of https://github.com/openssl/openssl.git
Fix a memory leak is ossl_provider_doall_activated
If the callback fails then we don't correctly free providers that were already in our stack and that we up-refed earlier. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/18413)
This commit is contained in:
parent
da31939763
commit
b4be10dfcd
|
@ -1401,8 +1401,10 @@ int ossl_provider_doall_activated(OSSL_LIB_CTX *ctx,
|
||||||
for (curr = 0; curr < max; curr++) {
|
for (curr = 0; curr < max; curr++) {
|
||||||
OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
|
OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
|
||||||
|
|
||||||
if (!cb(prov, cbdata))
|
if (!cb(prov, cbdata)) {
|
||||||
|
curr = -1;
|
||||||
goto finish;
|
goto finish;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
curr = -1;
|
curr = -1;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue