From: Pierangelo Masarati Date: Tue, 18 Jan 2011 23:53:24 +0000 (+0000) Subject: increment lconn_refcnt so connection does not get closed (ITS#6788) X-Git-Tag: MIGRATION_CVS2GIT~192 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6d8e0d5b3ed810679d940c8ded0187c065a8203e;p=openldap increment lconn_refcnt so connection does not get closed (ITS#6788) --- diff --git a/libraries/libldap/open.c b/libraries/libldap/open.c index 5cc653139f..306c3e40b1 100644 --- a/libraries/libldap/open.c +++ b/libraries/libldap/open.c @@ -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 ); }