mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-14 19:03:20 +00:00
Do not leak in mg_connect_ws_opt()
PUBLISHED_FROM=e6de3b3747a1cd79c3930c2640fadc8356ffed61
This commit is contained in:
1 parent
a67323fc12
commit
f9d0ad9dc3
1 file changed
+2
-4
+2
-4
@@ -7779,12 +7779,10 @@ struct mg_connection *mg_connect_ws_opt(struct mg_mgr *mgr,
|
|||||||
struct mg_connection *nc = mg_connect_http_base(
|
struct mg_connection *nc = mg_connect_http_base(
|
||||||
mgr, ev_handler, opts, "ws://", "wss://", url, &path, &addr);
|
mgr, ev_handler, opts, "ws://", "wss://", url, &path, &addr);
|
||||||
|
|
||||||
if (nc == NULL) {
|
if (nc != NULL) {
|
||||||
return NULL;
|
mg_send_websocket_handshake2(nc, path, addr, protocol, extra_headers);
|
||||||
}
|
}
|
||||||
|
|
||||||
mg_send_websocket_handshake2(nc, path, addr, protocol, extra_headers);
|
|
||||||
|
|
||||||
MG_FREE(addr);
|
MG_FREE(addr);
|
||||||
return nc;
|
return nc;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user