aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--e2fsprogs/fsck.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/e2fsprogs/fsck.c b/e2fsprogs/fsck.c
index 8dd9785ee..012285103 100644
--- a/e2fsprogs/fsck.c
+++ b/e2fsprogs/fsck.c
@@ -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);