mirror of
https://github.com/cesanta/mongoose.git
synced 2025-08-06 13:37:34 +08:00
Do not leak in mg_connect_ws_opt()
PUBLISHED_FROM=e6de3b3747a1cd79c3930c2640fadc8356ffed61
This commit is contained in:
parent
a67323fc12
commit
f9d0ad9dc3
@ -7779,12 +7779,10 @@ struct mg_connection *mg_connect_ws_opt(struct mg_mgr *mgr,
|
||||
struct mg_connection *nc = mg_connect_http_base(
|
||||
mgr, ev_handler, opts, "ws://", "wss://", url, &path, &addr);
|
||||
|
||||
if (nc == NULL) {
|
||||
return NULL;
|
||||
if (nc != NULL) {
|
||||
mg_send_websocket_handshake2(nc, path, addr, protocol, extra_headers);
|
||||
}
|
||||
|
||||
mg_send_websocket_handshake2(nc, path, addr, protocol, extra_headers);
|
||||
|
||||
MG_FREE(addr);
|
||||
return nc;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user