From: Aram Sargsyan Date: Fri, 9 Dec 2022 12:41:38 +0000 (+0000) Subject: Fix dns_fwdtable_addfwd() error path cleanup bug X-Git-Tag: v9.16.37~6^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1950629ffade5531d102639261a31321f8cdbb39;p=thirdparty%2Fbind9.git Fix dns_fwdtable_addfwd() error path cleanup bug Free 'sizeof(dns_forwarder_t)' bytes of memory instead of 'sizeof(dns_sockaddr_t)' bytes, because `fwd` is a pointer to a 'dns_forwarder_t' type structure. (cherry picked from commit 0cc1b06d98676ab66200d388c48c3cd615aa0109) --- diff --git a/lib/dns/forward.c b/lib/dns/forward.c index 53d0c5ee4e3..c7c54cddced 100644 --- a/lib/dns/forward.c +++ b/lib/dns/forward.c @@ -103,7 +103,7 @@ cleanup: while (!ISC_LIST_EMPTY(forwarders->fwdrs)) { fwd = ISC_LIST_HEAD(forwarders->fwdrs); ISC_LIST_UNLINK(forwarders->fwdrs, fwd, link); - isc_mem_put(fwdtable->mctx, fwd, sizeof(isc_sockaddr_t)); + isc_mem_put(fwdtable->mctx, fwd, sizeof(dns_forwarder_t)); } isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t)); return (result);