Skip to content
This repository was archived by the owner on Aug 13, 2025. It is now read-only.

Commit 0cc1b06

Browse files
author
Aram Sargsyan
committed
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.
1 parent 40077f6 commit 0cc1b06

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/dns/forward.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ dns_fwdtable_addfwd(dns_fwdtable_t *fwdtable, const dns_name_t *name,
103103
while (!ISC_LIST_EMPTY(forwarders->fwdrs)) {
104104
fwd = ISC_LIST_HEAD(forwarders->fwdrs);
105105
ISC_LIST_UNLINK(forwarders->fwdrs, fwd, link);
106-
isc_mem_put(fwdtable->mctx, fwd, sizeof(isc_sockaddr_t));
106+
isc_mem_put(fwdtable->mctx, fwd, sizeof(dns_forwarder_t));
107107
}
108108
isc_mem_put(fwdtable->mctx, forwarders, sizeof(dns_forwarders_t));
109109
return (result);

0 commit comments

Comments
 (0)