[mod_enum] fix mem leak - ldns_resolver_new() - vanilla cfg.

This commit is contained in:
Dragos Oancea 2021-03-16 14:45:12 +00:00
parent 2c2f2f9606
commit b775c1f91a
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);
}