From e578095bc26bfeda3b5fba4f78941c1140ae3908 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. --- source/nsswitch/winbindd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/nsswitch') diff --git a/source/nsswitch/winbindd.c b/source/nsswitch/winbindd.c index 1b3c037e3c3..1df1a1d27b8 100644 --- a/source/nsswitch/winbindd.c +++ b/source/nsswitch/winbindd.c @@ -610,8 +610,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