From 36a0bf14e924ff2e433410fcc062fc36bc0a569e Mon Sep 17 00:00:00 2001 From: Mark Andrews Date: Fri, 19 Oct 2018 19:23:39 +1100 Subject: [PATCH] free key on error (cherry picked from commit 607c2d7441b5b56272765dfd6ee56de983c3b407) --- lib/dns/dst_api.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/dns/dst_api.c b/lib/dns/dst_api.c index 97fee68369..107891624b 100644 --- a/lib/dns/dst_api.c +++ b/lib/dns/dst_api.c @@ -877,6 +877,9 @@ dst_key_fromgssapi(dns_name_t *name, gss_ctx_id_t gssctx, isc_mem_t *mctx, *keyp = key; result = ISC_R_SUCCESS; out: + if (result != ISC_R_SUCCESS) { + dst_key_free(&key); + } return result; }