summaryrefslogtreecommitdiff
path: root/source3/lib
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2017-08-30 17:49:54 +0200
committerKarolin Seeger <kseeger@samba.org>2017-09-11 01:18:18 +0200
commit36aa4af299288cd14a04d695b45269021062be70 (patch)
treeb3b9e7028cb9e6e530f6169d67dc4b8bddf5d481 /source3/lib
parentf08b212c5cfbd42410b6114df2c75c8b68b6e9bc (diff)
downloadsamba-36aa4af299288cd14a04d695b45269021062be70.tar.gz
messaging: Avoid a socket leak after fork
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13006 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Tue Sep 5 19:12:34 CEST 2017 on sn-devel-144 (cherry picked from commit d1c96dc0ac95322ce46703a11002873faf55a26c)
Diffstat (limited to 'source3/lib')
-rw-r--r--source3/lib/messages_dgm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source3/lib/messages_dgm.c b/source3/lib/messages_dgm.c
index f29180d7ec2..9d87746fa2c 100644
--- a/source3/lib/messages_dgm.c
+++ b/source3/lib/messages_dgm.c
@@ -280,7 +280,8 @@ static int messaging_dgm_out_destructor(struct messaging_dgm_out *out)
{
DLIST_REMOVE(out->ctx->outsocks, out);
- if (tevent_queue_length(out->queue) != 0) {
+ if ((tevent_queue_length(out->queue) != 0) &&
+ (getpid() == out->ctx->pid)) {
/*
* We have pending jobs. We can't close the socket,
* this has been handed over to messaging_dgm_out_queue_state.