Skip to content

Commit

Permalink
child->io could be NULL, from Tilo Stritzky.
Browse files Browse the repository at this point in the history
  • Loading branch information
nicm committed Jun 16, 2015
1 parent 808be67 commit 0bd6db0
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions fdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -832,9 +832,11 @@ main(int argc, char **argv)
(long) child->pid);
kill(child->pid, SIGTERM);

io_close(child->io);
io_free(child->io);
child->io = NULL;
if (child->io != NULL) {
io_close(child->io);
io_free(child->io);
child->io = NULL;
}
}
}
}
Expand Down Expand Up @@ -866,8 +868,10 @@ main(int argc, char **argv)
child = ARRAY_ITEM(&children, i);
kill(child->pid, SIGTERM);

io_close(child->io);
io_free(child->io);
if (child->io != NULL) {
io_close(child->io);
io_free(child->io);
}
xfree(child);
}
ARRAY_FREE(&children);
Expand Down

0 comments on commit 0bd6db0

Please sign in to comment.