From: Aram Sargsyan Date: Mon, 15 Aug 2022 11:40:21 +0000 (+0000) Subject: Fix tkey.c:buildquery() function's error handling X-Git-Tag: v9.18.7~29^2~1 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=b46e53a2e315eaec327e3b2a2804e7f6ac605ef2;p=thirdparty%2Fbind9.git Fix tkey.c:buildquery() function's error handling Add the missing cleanup code. (cherry picked from commit 4237ab9550eeaea7121e3e3392fd14c26b5150f0) --- diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c index 3ab0565e348..de2a0a8d30a 100644 --- a/lib/dns/tkey.c +++ b/lib/dns/tkey.c @@ -1020,6 +1020,18 @@ failure: if (dynbuf != NULL) { isc_buffer_free(&dynbuf); } + if (rdata != NULL) { + dns_message_puttemprdata(msg, &rdata); + } + if (tkeylist != NULL) { + dns_message_puttemprdatalist(msg, &tkeylist); + } + if (tkeyset != NULL) { + if (dns_rdataset_isassociated(tkeyset)) { + dns_rdataset_disassociate(tkeyset); + } + dns_message_puttemprdataset(msg, &tkeyset); + } return (result); }