[mod_enum] Fix use-after-free if creating resolver from file failed
This commit is contained in:
parent
6c97e3b0f4
commit
afc8d78a18
|
@ -497,6 +497,7 @@ switch_status_t ldns_lookup(const char *number, const char *root, char *server_n
|
||||||
/* create a new resolver from /etc/resolv.conf */
|
/* create a new resolver from /etc/resolv.conf */
|
||||||
if (res) {
|
if (res) {
|
||||||
ldns_resolver_free(res);
|
ldns_resolver_free(res);
|
||||||
|
res = NULL;
|
||||||
}
|
}
|
||||||
s = ldns_resolver_new_frm_file(&res, NULL);
|
s = ldns_resolver_new_frm_file(&res, NULL);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue