summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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;
}