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.
@@ -1401,9 +1401,11 @@ int ossl_provider_doall_activated(OSSL_LIB_CTX *ctx,
for (curr = 0; curr < max; curr++) {
OSSL_PROVIDER *prov = sk_OSSL_PROVIDER_value(provs, curr);
- if (!cb(prov, cbdata))
+ if (!cb(prov, cbdata)) {
+ curr = -1;
goto finish;
}
+ }
curr = -1;
ret = 1;
