]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Fix memory leak in isc_hmac_init
authorMark Andrews <marka@isc.org>
Fri, 24 Feb 2023 01:57:39 +0000 (12:57 +1100)
committerMark Andrews <marka@isc.org>
Sun, 26 Feb 2023 22:56:07 +0000 (22:56 +0000)
If EVP_DigestSignInit failed 'pkey' was not freed.

lib/isc/hmac.c

index 7d62165555ee3bc54a955e4cd0e2aa48629fc357..8fce30bda907e14228234fc60d1cd4c3dd23e50a 100644 (file)
@@ -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);
        }