Free fetched digest in show_digests
Fixes #24892
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tom Cosgrove <tom.cosgrove@arm.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/25046)
(cherry picked from commit 871c534d39
)
This commit is contained in:
parent
422a13fb5c
commit
eb0df13959
1 changed files with 4 additions and 3 deletions
|
@ -479,7 +479,7 @@ int dgst_main(int argc, char **argv)
|
|||
static void show_digests(const OBJ_NAME *name, void *arg)
|
||||
{
|
||||
struct doall_dgst_digests *dec = (struct doall_dgst_digests *)arg;
|
||||
const EVP_MD *md = NULL;
|
||||
EVP_MD *md = NULL;
|
||||
|
||||
/* Filter out signed digests (a.k.a signature algorithms) */
|
||||
if (strstr(name->name, "rsa") != NULL || strstr(name->name, "RSA") != NULL)
|
||||
|
@ -491,8 +491,7 @@ static void show_digests(const OBJ_NAME *name, void *arg)
|
|||
/* Filter out message digests that we cannot use */
|
||||
md = EVP_MD_fetch(app_get0_libctx(), name->name, app_get0_propq());
|
||||
if (md == NULL) {
|
||||
md = EVP_get_digestbyname(name->name);
|
||||
if (md == NULL)
|
||||
if (EVP_get_digestbyname(name->name) == NULL)
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -503,6 +502,8 @@ static void show_digests(const OBJ_NAME *name, void *arg)
|
|||
} else {
|
||||
BIO_printf(dec->bio, " ");
|
||||
}
|
||||
|
||||
EVP_MD_free(md);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue