mirror of
https://github.com/isc-projects/bind9.git
synced 2026-06-11 02:29:59 -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.
This commit is contained in:
parent
da6a85dc63
commit
5cd17c8adc
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