summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 10:06:28 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-19 10:06:28 (EDT)
commit0e3b97a9d7b6ae77b98efee57cf9119d684f2be9 (patch)
treeeddde87c57a921e17a8902b91e8fc280cc9f9b58 /src
parentd79a99b0910f0cea5ec4c8332fa162c46bae2492 (diff)
main: Fix list free loop
Diffstat (limited to 'src')
-rw-r--r--src/main.c8
1 files changed, 4 insertions, 4 deletions
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;
}