mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-16 11:57:39 -05:00
ITS#6930 Plug ldapi://too-long-path socket leak.
Klocwork issue#117, ldap_connect_to_path().
This commit is contained in:
parent
e2e5a8504d
commit
a1cb490d0c
1 changed files with 6 additions and 9 deletions
|
|
@ -328,11 +328,6 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv, int async)
|
|||
|
||||
oslocal_debug(ld, "ldap_connect_to_path\n",0,0,0);
|
||||
|
||||
s = ldap_pvt_socket( ld );
|
||||
if ( s == AC_SOCKET_INVALID ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
if ( path == NULL || path[0] == '\0' ) {
|
||||
path = LDAPI_SOCK;
|
||||
} else {
|
||||
|
|
@ -342,6 +337,11 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv, int async)
|
|||
}
|
||||
}
|
||||
|
||||
s = ldap_pvt_socket( ld );
|
||||
if ( s == AC_SOCKET_INVALID ) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
oslocal_debug(ld, "ldap_connect_to_path: Trying %s\n", path, 0, 0);
|
||||
|
||||
memset( &server, '\0', sizeof(server) );
|
||||
|
|
@ -351,10 +351,7 @@ ldap_connect_to_path(LDAP *ld, Sockbuf *sb, LDAPURLDesc *srv, int async)
|
|||
rc = ldap_pvt_connect(ld, s, &server, async);
|
||||
|
||||
if (rc == 0) {
|
||||
int err;
|
||||
err = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&server );
|
||||
if ( err )
|
||||
rc = err;
|
||||
rc = ldap_int_connect_cbs( ld, sb, &s, srv, (struct sockaddr *)&server );
|
||||
}
|
||||
if ( rc ) {
|
||||
ldap_pvt_close_socket(ld, s);
|
||||
|
|
|
|||
Loading…
Reference in a new issue