bind/backport-In-hmac_createctx-free-ctx-on-isc_hmac_init-failure.patch
zhang-hao-jon 0d83bd37d3 bind: fix some patches from commity
(cherry picked from commit b9ba93249f3ec5ae3c4398af03514c6c5c850690)
2023-04-11 22:17:39 +08:00

28 lines
892 B
Diff

From d0c92a31a997d8c2fa48dd3a2ed90b11e54cfabf Mon Sep 17 00:00:00 2001
From: Mark Andrews <marka@isc.org>
Date: Fri, 17 Feb 2023 11:44:45 +1100
Subject: [PATCH] In hmac_createctx free ctx on isc_hmac_init failure
Conflict: NA
Reference: https://gitlab.isc.org/isc-projects/bind9/-/commit/d0c92a31a997d8c2fa48dd3a2ed90b11e54cfabf
(cherry picked from commit d22257a370c69060e17a466db7698c96e23526b5)
---
lib/dns/hmac_link.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/dns/hmac_link.c b/lib/dns/hmac_link.c
index d839f1123b..2872ff2c89 100644
--- a/lib/dns/hmac_link.c
+++ b/lib/dns/hmac_link.c
@@ -170,6 +170,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);
}
--
2.23.0