From 50b3dbef68288c5e21d10070a4ce1845574ecea7 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 8 Feb 2007 00:28:25 +0000 Subject: r21228: Fix for fd leak on error path. Thanks to dleonard@vintela.com for this fix ! Jeremy. (This used to be commit 70b5db7d8c6aa324ad98436fe3fafe715c04c5a8) --- source3/nsswitch/winbindd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source3') diff --git a/source3/nsswitch/winbindd.c b/source3/nsswitch/winbindd.c index 9a4d7e3aed..9a6f1f3c28 100644 --- a/source3/nsswitch/winbindd.c +++ b/source3/nsswitch/winbindd.c @@ -622,8 +622,10 @@ static void new_connection(int listen_sock, BOOL privileged) /* Create new connection structure */ - if ((state = TALLOC_ZERO_P(NULL, struct winbindd_cli_state)) == NULL) + if ((state = TALLOC_ZERO_P(NULL, struct winbindd_cli_state)) == NULL) { + close(sock); return; + } state->sock = sock; -- cgit