From 6419da5eba90068f712136f43efac271f74dfee6 Mon Sep 17 00:00:00 2001 From: Thulinma Date: Thu, 13 Dec 2018 16:48:17 +0100 Subject: [PATCH] Fixed crash in child of executable with grim_reaper active --- lib/procs.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/procs.cpp b/lib/procs.cpp index dd6ffa95..1ee71b9f 100644 --- a/lib/procs.cpp +++ b/lib/procs.cpp @@ -65,6 +65,7 @@ bool Util::Procs::isRunning(pid_t pid){ /// After that waits up to 5 seconds for children to exit, then sends SIGKILL to /// all remaining children. Waits one more second for cleanup to finish, then exits. void Util::Procs::exit_handler() { + if (!handler_set){return;} int waiting = 0; std::set listcopy; { @@ -320,6 +321,7 @@ pid_t Util::Procs::StartPiped(const char * const * argv, int * fdin, int * fdout } pid = fork(); if (pid == 0) { //child + handler_set = false; //Close all sockets in the socketList for (std::set::iterator it = Util::Procs::socketList.begin(); it != Util::Procs::socketList.end(); ++it){ close(*it);