From 749c13cf0448771393ff501a1e1b940e5a15bb48 Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 24 Feb 2023 12:57:39 +1100 Subject: [PATCH] Fix memory leak in isc_hmac_init If EVP_DigestSignInit failed 'pkey' was not freed. (cherry picked from commit cf5f13367965e5318487e0c31a56ba53cc2098b3) --- lib/isc/hmac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/isc/hmac.c b/lib/isc/hmac.c index 7d62165555..8fce30bda9 100644 --- a/lib/isc/hmac.c +++ b/lib/isc/hmac.c @@ -59,6 +59,7 @@ isc_hmac_init(isc_hmac_t *hmac, const void *key, const size_t keylen, } if (EVP_DigestSignInit(hmac, NULL, md_type, NULL, pkey) != 1) { + EVP_PKEY_free(pkey); return (ISC_R_CRYPTOFAILURE); }