From 76ee92afb4285cd128297deed425cbb4f2ef5a1a Mon Sep 17 00:00:00 2001 From: Andy Green Date: Tue, 18 Aug 2020 13:20:44 +0100 Subject: [PATCH] coverity: 62574: wsi mux close: dumb down iterator so no dead code --- lib/core-net/wsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/core-net/wsi.c b/lib/core-net/wsi.c index a090cbd6c..9ad1d85a5 100644 --- a/lib/core-net/wsi.c +++ b/lib/core-net/wsi.c @@ -1150,11 +1150,13 @@ void lws_wsi_mux_close_children(struct lws *wsi, int reason) { struct lws *wsi2; + struct lws **w; if (!wsi->mux.child_list) return; - lws_start_foreach_llp(struct lws **, w, wsi->mux.child_list) { + w = &wsi->mux.child_list; + while (*w) { lwsl_info(" closing child %p\n", *w); /* disconnect from siblings */ wsi2 = (*w)->mux.sibling_list; @@ -1163,8 +1165,7 @@ lws_wsi_mux_close_children(struct lws *wsi, int reason) (*w)->socket_is_permanently_unusable = 1; __lws_close_free_wsi(*w, reason, "mux child recurse"); *w = wsi2; - continue; - } lws_end_foreach_llp(w, mux.sibling_list); + } }