[Date Prev][Date Next] [Chronological] [Thread] [Top]

Inconsistent use of tcp_close() causes handle leaks (ITS#667)



Full_Name: Jay Sillars
Version: 1.2.11
OS: WinNT
URL: ftp://ftp.openldap.org/incoming/
Submission from: (NULL) (209.46.83.137)


On the windows platform socket file descriptors must be closed with the
closesocket function rather than the close function.  The close function will
fail, and the program will leak handles.  The macro tcp_close() does this
correctly, but is not being called consistently.  Here are the lines I found
that should be changed to use tcp_close() instead of close():

openldap-1.2.11\clients\gopher\go500.c(253):			close( s );
openldap-1.2.11\clients\gopher\go500.c(262):			close( ns );
openldap-1.2.11\clients\gopher\go500gw.c(281):			close( s );
openldap-1.2.11\clients\gopher\go500gw.c(290):			close( ns );
openldap-1.2.11\libraries\libldap\cldap.c(87):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(92):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(98):	close( s );
openldap-1.2.11\libraries\libldap\cldap.c(133):			close( s );
openldap-1.2.11\libraries\libldap\cldap.c(142):		    close( s );
openldap-1.2.11\libraries\libldap\cldap.c(157):	    close( s );
openldap-1.2.11\servers\ldapd\main.c(420):			close(ns);
openldap-1.2.11\servers\ldapd\main.c(438):		close( tcps );
openldap-1.2.11\servers\ldapd\main.c(452):			close( tcps );
openldap-1.2.11\servers\ldapd\main.c(469):			close( ns );
openldap-1.2.11\servers\ldapd\main.c(476):			close( ns );
openldap-1.2.11\servers\slapd\daemon.c(400):	close( tcps );
openldap-1.2.11\servers\slapd\main.c(292):				close( c.c_sb.sb_sd );
openldap-1.2.11\servers\slapd\result.c(454):		close( conn->c_sb.sb_sd );