From: Stephan Bosch Date: Fri, 21 Aug 2020 19:28:47 +0000 (+0200) Subject: lib-http: http-server - Restructure http_server_shut_down() to use while statement X-Git-Tag: 2.4.1~64 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=81c4b8b32bc08cc29e7c0fa09a42f4d21a244f90;p=thirdparty%2Fdovecot%2Fcore.git lib-http: http-server - Restructure http_server_shut_down() to use while statement Original for statement was objectionable to static analyzer. New structure is equivalent to similar code elsewhere in Dovecot. --- diff --git a/src/lib-http/http-server.c b/src/lib-http/http-server.c index d0cdf3a57b..f0a6a86554 100644 --- a/src/lib-http/http-server.c +++ b/src/lib-http/http-server.c @@ -109,17 +109,18 @@ void http_server_switch_ioloop(struct http_server *server) void http_server_shut_down(struct http_server *server) { - struct connection *_conn, *_next; + struct connection *_conn; server->shutting_down = TRUE; - for (_conn = server->conn_list->connections; - _conn != NULL; _conn = _next) { + _conn = server->conn_list->connections; + while (_conn != NULL) { struct http_server_connection *conn = (struct http_server_connection *)_conn; + struct connection *_next = _conn->next; - _next = _conn->next; (void)http_server_connection_shut_down(conn); + _conn = _next; } }