Author: jra
Date: 2007-02-08 00:28:25 +0000 (Thu, 08 Feb 2007)
New Revision: 21228

WebSVN: 
http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21228

Log:
Fix for fd leak on error path. Thanks to
[EMAIL PROTECTED] for this fix !
Jeremy.

Modified:
   branches/SAMBA_3_0/source/nsswitch/winbindd.c
   branches/SAMBA_3_0_25/source/nsswitch/winbindd.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/winbindd.c       2007-02-08 00:14:37 UTC 
(rev 21227)
+++ branches/SAMBA_3_0/source/nsswitch/winbindd.c       2007-02-08 00:28:25 UTC 
(rev 21228)
@@ -622,8 +622,10 @@
        
        /* 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;
 

Modified: branches/SAMBA_3_0_25/source/nsswitch/winbindd.c
===================================================================
--- branches/SAMBA_3_0_25/source/nsswitch/winbindd.c    2007-02-08 00:14:37 UTC 
(rev 21227)
+++ branches/SAMBA_3_0_25/source/nsswitch/winbindd.c    2007-02-08 00:28:25 UTC 
(rev 21228)
@@ -610,8 +610,10 @@
        
        /* 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;
 

Reply via email to