Merge pull request #1120 from dragos-oancea/mod_enum_fix_leak

[mod_enum] fix mem leak - ldns_resolver_new() - vanilla cfg.
This commit is contained in:
Andrey Volk 2021-03-16 18:12:40 +03:00 committed by GitHub
commit 67791c1925
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -496,6 +496,9 @@ switch_status_t ldns_lookup(const char *number, const char *root, char *server_n
if (!added_server) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "No Nameservers specified, using host default\n");
/* create a new resolver from /etc/resolv.conf */
if (res) {
ldns_resolver_free(res);
}
s = ldns_resolver_new_frm_file(&res, NULL);
}