mirror of
https://github.com/libevent/libevent.git
synced 2025-01-09 00:56:20 +08:00
ws: fix potential NULL pointer dereference
This commit is contained in:
parent
d1a90d09dc
commit
628f39bb90
3
ws.c
3
ws.c
@ -416,6 +416,9 @@ evws_new_session(
|
|||||||
evws->http_server = evcon->http_server;
|
evws->http_server = evcon->http_server;
|
||||||
|
|
||||||
evws->bufev = evhttp_start_ws_(req);
|
evws->bufev = evhttp_start_ws_(req);
|
||||||
|
if (evws->bufev == NULL) {
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
if (options & BEV_OPT_THREADSAFE) {
|
if (options & BEV_OPT_THREADSAFE) {
|
||||||
if (bufferevent_enable_locking_(evws->bufev, NULL) < 0)
|
if (bufferevent_enable_locking_(evws->bufev, NULL) < 0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user