diff --git a/lib/dns/tkey.c b/lib/dns/tkey.c index 3ab0565e34..de2a0a8d30 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); }