diff mbox series

swuforward: replace LIST_FOREACH with LIST_FOREACH_SAFE

Message ID 20200416191401.10717-2-sbabic@denx.de
State Accepted
Headers show
Series swuforward: replace LIST_FOREACH with LIST_FOREACH_SAFE | expand

Commit Message

Stefano Babic April 16, 2020, 7:13 p.m. UTC
Fix coverity #292169

Signed-off-by: Stefano Babic <sbabic@denx.de>
---
 handlers/swuforward_handler.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/handlers/swuforward_handler.c b/handlers/swuforward_handler.c
index 2febdd0..8719967 100644
--- a/handlers/swuforward_handler.c
+++ b/handlers/swuforward_handler.c
@@ -282,7 +282,7 @@  static int install_remote_swu(struct img_type *img,
 	void __attribute__ ((__unused__)) *data)
 {
 	struct hnd_priv priv;
-	struct curlconn *conn;
+	struct curlconn *conn, *tmp;
 	int ret;
 	struct dict_list_elem *url;
 	struct dict_list *urls;
@@ -400,7 +400,7 @@  static int install_remote_swu(struct img_type *img,
 	}
 
 handler_exit:
-	LIST_FOREACH(conn, &priv.conns, next) {
+	LIST_FOREACH_SAFE(conn, &priv.conns, next, tmp) {
 		index = 0;
 		LIST_REMOVE(conn, next);
 		swuforward_ws_free(conn);