s3:util: remove reinit_after_fork_pipe_handler before sending SIGTERM
authorStefan Metzmacher <metze@samba.org>
Thu, 22 Mar 2018 11:32:15 +0000 (12:32 +0100)
committerJeremy Allison <jra@samba.org>
Tue, 24 Apr 2018 17:41:14 +0000 (19:41 +0200)
We should not keep the tevent_fd active when we sending us a SIGTERM,
this is not a real problem, but due to a different bug I triggered
a 100% cpu loop. I think it's safer to idle in that case instead
of waisting a lot of energy.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/lib/util.c

index 5f786f95d3e2eccd113a39eec585d195713c5747..394fa5fd19186a96940f250c1605a18b101c638d 100644 (file)
@@ -438,6 +438,7 @@ static void reinit_after_fork_pipe_handler(struct tevent_context *ev,
                 * we have reached EOF on stdin, which means the
                 * parent has exited. Shutdown the server
                 */
+               TALLOC_FREE(fde);
                (void)kill(getpid(), SIGTERM);
        }
 }