mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
test/test-changelist.c: fix potential NULL pointer dereference
This commit is contained in:
parent
66428fb969
commit
6f9f2f3a09
@ -188,9 +188,12 @@ main(int argc, char **argv)
|
|||||||
|
|
||||||
/* Initialize a timeout to terminate the test */
|
/* Initialize a timeout to terminate the test */
|
||||||
timeout = evtimer_new(base,timeout_cb,&timeout);
|
timeout = evtimer_new(base,timeout_cb,&timeout);
|
||||||
|
if (timeout == NULL)
|
||||||
|
return (1);
|
||||||
/* and watch for writability on one end of the pipe */
|
/* and watch for writability on one end of the pipe */
|
||||||
ev = event_new(base,pair[1],EV_WRITE | EV_PERSIST, write_cb, &ev);
|
ev = event_new(base,pair[1],EV_WRITE | EV_PERSIST, write_cb, &ev);
|
||||||
|
if (ev == NULL)
|
||||||
|
return (1);
|
||||||
tv.tv_sec = 1;
|
tv.tv_sec = 1;
|
||||||
tv.tv_usec = 500*1000;
|
tv.tv_usec = 500*1000;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user