Fix checking return value of the evdns_base_resolv_conf_parse()

Reported-by: Maxim Gorbachyov <maxim.gorbachyov@gmail.com>
(cherry picked from commit c3f353450e94248ee677a068ed2c4ed29d64f79e)
This commit is contained in:
Azat Khuzhin 2019-09-05 23:31:19 +03:00
parent e0e5f3bdd2
commit fc51bf2c5b
2 changed files with 3 additions and 3 deletions

View File

@ -4032,7 +4032,7 @@ evdns_base_new(struct event_base *event_base, int flags)
#else
r = evdns_base_resolv_conf_parse(base, opts, "/etc/resolv.conf");
#endif
if (r == -1) {
if (r) {
evdns_base_free_and_unlock(base, 0);
return NULL;
}

View File

@ -225,8 +225,8 @@ main(int c, char **v) {
res = evdns_base_resolv_conf_parse(evdns_base,
DNS_OPTION_NAMESERVERS, o.resolv_conf);
if (res < 0) {
fprintf(stderr, "Couldn't configure nameservers");
if (res) {
fprintf(stderr, "Couldn't configure nameservers\n");
return 1;
}
}