]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
In hmac_createctx free ctx on isc_hmac_init failure
authorMark Andrews <marka@isc.org>
Fri, 17 Feb 2023 00:44:45 +0000 (11:44 +1100)
committerMark Andrews <marka@isc.org>
Fri, 17 Feb 2023 21:58:56 +0000 (21:58 +0000)
lib/dns/hmac_link.c

index 4a753fd60d8524d52199b32b6311c5ef6a75580c..0a0df8a25bb7fc45f332a19e399b9858e7ac9178 100644 (file)
@@ -165,6 +165,7 @@ hmac_createctx(const isc_md_type_t *type, const dst_key_t *key,
        result = isc_hmac_init(ctx, hkey->key, isc_md_type_get_block_size(type),
                               type);
        if (result != ISC_R_SUCCESS) {
+               isc_hmac_free(ctx);
                return (DST_R_UNSUPPORTEDALG);
        }