mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
tests: Fix potential NULL pointer dereference
This commit is contained in:
parent
d3f6c78e3a
commit
d1a90d09dc
@ -197,6 +197,10 @@ main(int argc, char **argv)
|
||||
|
||||
base = event_base_new();
|
||||
|
||||
if (base == NULL) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
for (i=0; i < PARALLELISM; ++i) {
|
||||
if (launch_request() < 0)
|
||||
fprintf(stderr, "Cannot launch %i request\n", i);
|
||||
|
@ -2116,6 +2116,8 @@ test_loopexit_multiple(void)
|
||||
|
||||
base = event_base_new();
|
||||
|
||||
tt_assert(base);
|
||||
|
||||
tv.tv_usec = 200*1000;
|
||||
tv.tv_sec = 0;
|
||||
event_base_loopexit(base, &tv);
|
||||
|
@ -627,6 +627,8 @@ wm_acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
|
||||
|
||||
bev = bufferevent_ssl_socket_new(
|
||||
base, fd, ssl, BUFFEREVENT_SSL_ACCEPTING, ctx->flags);
|
||||
|
||||
tt_assert(bev);
|
||||
|
||||
TT_BLATHER(("wm_transfer-%s(%p): accept",
|
||||
ctx->server ? "server" : "client", bev));
|
||||
@ -638,6 +640,8 @@ wm_acceptcb(struct evconnlistener *listener, evutil_socket_t fd,
|
||||
|
||||
/* Only accept once, then disable ourself. */
|
||||
evconnlistener_disable(listener);
|
||||
end:
|
||||
;
|
||||
}
|
||||
static void
|
||||
regress_bufferevent_openssl_wm(void *arg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user