Skip to content
Snippets Groups Projects
Commit 3562e441 authored by Andy Green's avatar Andy Green
Browse files

client-fix-header-stash-leak-on-close-before-success

parent 003bd7dc
No related branches found
No related tags found
No related merge requests found
...@@ -326,6 +326,22 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason) ...@@ -326,6 +326,22 @@ lws_close_free_wsi(struct lws *wsi, enum lws_close_status reason)
} }
#endif #endif
#if !defined(LWS_NO_CLIENT)
if (wsi->mode == LWSCM_HTTP_CLIENT ||
wsi->mode == LWSCM_WSCL_WAITING_CONNECT ||
wsi->mode == LWSCM_WSCL_WAITING_PROXY_REPLY ||
wsi->mode == LWSCM_WSCL_ISSUE_HANDSHAKE ||
wsi->mode == LWSCM_WSCL_ISSUE_HANDSHAKE2 ||
wsi->mode == LWSCM_WSCL_WAITING_SSL ||
wsi->mode == LWSCM_WSCL_WAITING_SERVER_REPLY ||
wsi->mode == LWSCM_WSCL_WAITING_EXTENSION_CONNECT ||
wsi->mode == LWSCM_WSCL_WAITING_SOCKS_GREETING_REPLY ||
wsi->mode == LWSCM_WSCL_WAITING_SOCKS_CONNECT_REPLY ||
wsi->mode == LWSCM_WSCL_WAITING_SOCKS_AUTH_REPLY)
if (wsi->u.hdr.stash)
lws_free_set_NULL(wsi->u.hdr.stash);
#endif
if (wsi->mode == LWSCM_RAW) { if (wsi->mode == LWSCM_RAW) {
wsi->protocol->callback(wsi, wsi->protocol->callback(wsi,
LWS_CALLBACK_RAW_CLOSE, wsi->user_space, NULL, 0); LWS_CALLBACK_RAW_CLOSE, wsi->user_space, NULL, 0);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment