aboutsummaryrefslogtreecommitdiff
path: root/toys/pending/fsck.c
diff options
context:
space:
mode:
authorAshwini Sharma <ak.ashwini1981@gmail.com>2014-07-14 05:44:29 -0500
committerAshwini Sharma <ak.ashwini1981@gmail.com>2014-07-14 05:44:29 -0500
commit30f6ef5fcd571c554c2c59585d126b92793379d0 (patch)
tree9f4d0292ba4edcb03b653913620422b3d7c4dc98 /toys/pending/fsck.c
parentfbe5dda4d488fdd9961ef1fd21beee59467d8e29 (diff)
downloadtoybox-30f6ef5fcd571c554c2c59585d126b92793379d0.tar.gz
fdisk : partitions > 60, are deleted, offset entry for extended partitions was wrong.
fsck: memory leak/segfault resolved. ftpget : warning for unused variable 'ptr' removed.
Diffstat (limited to 'toys/pending/fsck.c')
-rw-r--r--toys/pending/fsck.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/toys/pending/fsck.c b/toys/pending/fsck.c
index b968844a..56dfb5df 100644
--- a/toys/pending/fsck.c
+++ b/toys/pending/fsck.c
@@ -215,8 +215,10 @@ static void do_fsck(struct f_sys_info *finfo)
xputc('\n');
}
- if (toys.optflags & FLAG_N) return;
- else {
+ if (toys.optflags & FLAG_N) {
+ free(args);
+ return;
+ } else {
if ((pid = fork()) < 0) {
perror_msg(args[0]);
return;
@@ -244,12 +246,13 @@ static int wait_for(int for_all)
{
pid_t pid;
int status = 0, child_exited;
- struct child_list *prev, *temp = c_list;
- prev = temp;
+ struct child_list *prev, *temp;
errno = 0;
if (!c_list) return 0;
while ((pid = wait(&status))) {
+ temp = c_list;
+ prev = temp;
if (TT.sig_num) kill_all();
child_exited = 0;
if (pid < 0) {