mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
decoder: fix Coverity 1473236 & 1473386: resource leaks
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14596)
This commit is contained in:
parent
77b8b49bdd
commit
07aa88cccf
@ -312,6 +312,7 @@ int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx,
|
||||
EVP_KEYMGMT_free(keymgmt);
|
||||
}
|
||||
sk_EVP_KEYMGMT_free(keymgmts);
|
||||
keymgmts = NULL;
|
||||
|
||||
/*
|
||||
* Finally, find all decoders that have any keymgmt of the collected
|
||||
@ -325,6 +326,7 @@ int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx,
|
||||
OSSL_DECODER_do_all_provided(libctx,
|
||||
collect_decoder, &collect_decoder_data);
|
||||
sk_OPENSSL_CSTRING_free(names);
|
||||
names = NULL;
|
||||
|
||||
if (collect_decoder_data.error_occurred)
|
||||
goto err;
|
||||
@ -343,6 +345,9 @@ int ossl_decoder_ctx_setup_for_pkey(OSSL_DECODER_CTX *ctx,
|
||||
ok = 1;
|
||||
err:
|
||||
decoder_clean_pkey_construct_arg(process_data);
|
||||
sk_EVP_KEYMGMT_pop_free(keymgmts, EVP_KEYMGMT_free);
|
||||
sk_OPENSSL_CSTRING_free(names);
|
||||
|
||||
return ok;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user