From 0e3b97a9d7b6ae77b98efee57cf9119d684f2be9 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Wed, 19 Apr 2023 10:06:28 -0400 Subject: main: Fix list free loop --- (limited to 'src') diff --git a/src/main.c b/src/main.c index fdfc290..c3cea7c 100644 --- a/src/main.c +++ b/src/main.c @@ -73,10 +73,10 @@ main(int argc, char *argv[]) error1: opkg_opk_opk_free_outer(opk); error0: - for (control_files_tail = control_files_head; - control_files_tail != NULL; ) { - control_files_tail = control_files_head->next; - free(control_files_head); + while (control_files_head != NULL) { + control_files_tail = control_files_head; + control_files_head = control_files_head->next; + free(control_files_tail); } return EXIT_FAILURE; } -- cgit v0.9.1