mirror of
https://github.com/cuberite/libevent.git
synced 2025-08-03 09:16:30 -04:00
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:
parent
e0e5f3bdd2
commit
fc51bf2c5b
2
evdns.c
2
evdns.c
@ -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;
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user