increment lconn_refcnt so connection does not get closed (ITS#6788)

This commit is contained in:
Pierangelo Masarati 2011-01-18 23:53:24 +00:00
parent d829953dd0
commit 6d8e0d5b3e

View File

@ -447,6 +447,11 @@ ldap_int_open_connection(
return( 0 );
}
/*
* ldap_open_internal_connection - open connection and set file descriptor
*
* note: ldap_init_fd() may be preferable
*/
int
ldap_open_internal_connection( LDAP **ldp, ber_socket_t *fdp )
@ -504,6 +509,8 @@ ldap_open_internal_connection( LDAP **ldp, ber_socket_t *fdp )
ldap_set_option( ld, LDAP_OPT_PROTOCOL_VERSION, &rc );
*ldp = ld;
++ld->ld_defconn->lconn_refcnt; /* so it never gets closed/freed */
return( LDAP_SUCCESS );
}