From 37f2297b2a240a6578bef50cb06e1e11c6803e3e Mon Sep 17 00:00:00 2001 From: Alfred Sawaya Date: Sat, 2 Jun 2018 05:57:26 +0800 Subject: [PATCH] fix memleak when role h1 failed to upgrade to websocket --- lib/roles/h1/ops-h1.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/roles/h1/ops-h1.c b/lib/roles/h1/ops-h1.c index 1f5435619..27a4a021d 100644 --- a/lib/roles/h1/ops-h1.c +++ b/lib/roles/h1/ops-h1.c @@ -660,6 +660,9 @@ rops_destroy_role_h1(struct lws *wsi) ah = ah->next; } +#ifdef LWS_ROLE_WS + lws_free_set_NULL(wsi->ws); +#endif return 0; }