mirror of
https://github.com/isc-projects/bind9.git
synced 2026-05-28 04:34:54 -04:00
Fix memory leak in dns_catz_options_setdefault() for zonedir
When defaults->zonedir is set, opts->zonedir is unconditionally
overwritten without freeing the previous value. This leaks memory
on every catalog zone update when zonedir defaults are configured.
Free the existing opts->zonedir before replacing it.
(cherry picked from commit 5cd17c8adc)
This commit is contained in:
parent
ac042af576
commit
930d9042a1
1 changed files with 3 additions and 0 deletions
|
|
@ -225,6 +225,9 @@ dns_catz_options_setdefault(isc_mem_t *mctx, const dns_catz_options_t *defaults,
|
|||
}
|
||||
|
||||
if (defaults->zonedir != NULL) {
|
||||
if (opts->zonedir != NULL) {
|
||||
isc_mem_free(mctx, opts->zonedir);
|
||||
}
|
||||
opts->zonedir = isc_mem_strdup(mctx, defaults->zonedir);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue