[PATCH] winbindd: Avoid a fd leak when we can not fork

Volker Lendecke Volker.Lendecke at SerNet.DE
Tue Apr 9 08:38:46 MDT 2013


Things you find when you look at code...

Please review & push,

Thanks,

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de
-------------- next part --------------
From aa8f6e70d37093ad04214043563e54c116eccafe Mon Sep 17 00:00:00 2001
From: Volker Lendecke <vl at samba.org>
Date: Tue, 9 Apr 2013 16:37:29 +0200
Subject: [PATCH] winbindd: Avoid a fd leak when we can not fork

Signed-off-by: Volker Lendecke <vl at samba.org>
---
 source3/winbindd/winbindd_dual.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/source3/winbindd/winbindd_dual.c b/source3/winbindd/winbindd_dual.c
index e1e45d4..34896d5 100644
--- a/source3/winbindd/winbindd_dual.c
+++ b/source3/winbindd/winbindd_dual.c
@@ -1398,6 +1398,8 @@ static bool fork_domain_child(struct winbindd_child *child)
 
 	if (child->pid == -1) {
 		DEBUG(0, ("Could not fork: %s\n", strerror(errno)));
+		close(fdpair[0]);
+		close(fdpair[1]);
 		return False;
 	}
 
-- 
1.7.3.4



More information about the samba-technical mailing list