From 3f7ffeddac34e85c5c000c687dbdbd204e74b376 Mon Sep 17 00:00:00 2001 From: Alfred Sawaya Date: Sat, 2 Jun 2018 05:57:40 +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 49dfe4b47..8e7294799 100644 --- a/lib/roles/h1/ops-h1.c +++ b/lib/roles/h1/ops-h1.c @@ -656,6 +656,9 @@ rops_destroy_role_h1(struct lws *wsi) ah = ah->next; } +#ifdef LWS_ROLE_WS + lws_free_set_NULL(wsi->ws); +#endif return 0; }