mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Fix potential Null pointer dereference in dns-example.c (#1601)
This commit is contained in:
parent
a584efaa0e
commit
64decd48e2
@ -196,7 +196,17 @@ main(int c, char **v) {
|
||||
#endif
|
||||
|
||||
event_base = event_base_new();
|
||||
if (event_base == NULL) {
|
||||
fprintf(stderr, "Couldn't create new event_base\n");
|
||||
return 1;
|
||||
}
|
||||
evdns_base = evdns_base_new(event_base, EVDNS_BASE_DISABLE_WHEN_INACTIVE);
|
||||
if (evdns_base == NULL) {
|
||||
event_base_free(event_base);
|
||||
fprintf(stderr, "Couldn't create new evdns_base\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
evdns_set_log_fn(logfn);
|
||||
|
||||
if (o.servertest) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user