fsck: don't kill pid -1! (Roy Marples <roy at marples.name>)
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 2 Feb 2008 18:54:58 +0000 (18:54 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 2 Feb 2008 18:54:58 +0000 (18:54 -0000)
e2fsprogs/fsck.c

index 8dd9785ee474db656919b3d656edfdc570f2a8dd..012285103a5aa72661a503d1b3808d943a09b5ba 100644 (file)
@@ -663,6 +663,12 @@ static void execute(const char *type, const char *device, const char *mntpt,
        for (i = num_args+1; i < argc; i++)
                free(argv[i]);
 
+       /* No pid, so don't record an instance */
+       if (pid < 0) {
+               free(inst);
+               return;
+       }
+
        inst->pid = pid;
        inst->prog = argv[0];
        inst->type = xstrdup(type);