aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/fsck.c
diff options
context:
space:
mode:
Diffstat (limited to 'toys/pending/fsck.c')
-rw-r--r--toys/pending/fsck.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/toys/pending/fsck.c b/toys/pending/fsck.c
index 56dfb5df..ee35c04e 100644
--- a/toys/pending/fsck.c
+++ b/toys/pending/fsck.c
@@ -216,10 +216,13 @@ static void do_fsck(struct f_sys_info *finfo)
}
if (toys.optflags & FLAG_N) {
+ for (j=0;j<i;j++) free(args[i]);
free(args);
return;
} else {
if ((pid = fork()) < 0) {
+ for (j=0;j<i;j++) free(args[i]);
+ free(args);
perror_msg(args[0]);
return;
}
@@ -383,6 +386,7 @@ void fsck_main(void)
if (!TT.devices || (toys.optflags & FLAG_A)) {
toys.exitval = scan_all();
if (CFG_TOYBOX_FREE) goto free_all;
+ return; //if CFG_TOYBOX_FREE is not set, exit.
}
dev = TT.devices;