]> git.sur5r.net Git - openldap/commitdiff
increment lconn_refcnt so connection does not get closed (ITS#6788)
authorPierangelo Masarati <ando@openldap.org>
Tue, 18 Jan 2011 23:53:24 +0000 (23:53 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 18 Jan 2011 23:53:24 +0000 (23:53 +0000)
libraries/libldap/open.c

index 5cc653139f5442ac309670d9ab00ad048416f114..306c3e40b18963addfc32018adb5da6c1bf77f2f 100644 (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 );
 }