From: Mark Andrews Date: Fri, 24 Feb 2023 01:57:39 +0000 (+1100) Subject: Fix memory leak in isc_hmac_init X-Git-Tag: v9.19.11~21^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cf5f13367965e5318487e0c31a56ba53cc2098b3;p=thirdparty%2Fbind9.git Fix memory leak in isc_hmac_init If EVP_DigestSignInit failed 'pkey' was not freed. --- diff --git a/lib/isc/hmac.c b/lib/isc/hmac.c index 7d62165555e..8fce30bda90 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); }