aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/fsck.c
diff options
context:
space:
mode:
authorAshwini Sharma <ak.ashwini1981@gmail.com>2014-08-12 07:09:01 -0500
committerAshwini Sharma <ak.ashwini1981@gmail.com>2014-08-12 07:09:01 -0500
commit7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb (patch)
tree3a71927fe5198488d24af53b030d71797b67de35 /toys/pending/fsck.c
parent6a77734d1b1ac1938abbc33014b60cfb49828824 (diff)
downloadtoybox-7eb3e4364c2bcebd2fdfef52c07f5101aa03e5bb.tar.gz
Patches to commands for issues reported from static analysis tool.
portability.h.patch - it is for O_CLOEXEC, as compiler complained of it. Makefile.patch - for cleaning generated/*.o files and libopts.dat file [Fixup to uniq.c from Rob.]
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;