Commit f9d0ad9d authored by Sergey Lyubka's avatar Sergey Lyubka Committed by Cesanta Bot

Do not leak in mg_connect_ws_opt()

PUBLISHED_FROM=e6de3b3747a1cd79c3930c2640fadc8356ffed61
parent a67323fc
...@@ -7779,12 +7779,10 @@ struct mg_connection *mg_connect_ws_opt(struct mg_mgr *mgr, ...@@ -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;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment