]> git.sur5r.net Git - openldap/commitdiff
ITS#7241 unbind: free socket prior to destroying TLS context
authorJan Vcelak <jvcelak@redhat.com>
Thu, 12 Apr 2012 15:34:40 +0000 (17:34 +0200)
committerHoward Chu <hyc@openldap.org>
Mon, 25 Jun 2012 19:53:29 +0000 (12:53 -0700)
libraries/libldap/unbind.c

index 35a92a8d7e8b1eea2fad297e19d6c678d308fbe3..82bc12db25c92307c58b277d88758ea9c4cb2132 100644 (file)
@@ -129,6 +129,9 @@ ldap_ld_free(
                ld->ld_abandoned = NULL;
        }
        LDAP_MUTEX_UNLOCK( &ld->ld_res_mutex );
+
+       ber_sockbuf_free( ld->ld_sb );
+
        LDAP_MUTEX_LOCK( &ld->ld_ldopts_mutex );
 
        /* final close callbacks */
@@ -217,8 +220,6 @@ ldap_ld_free(
        }
        LDAP_MUTEX_UNLOCK( &ld->ld_ldopts_mutex );
 
-       ber_sockbuf_free( ld->ld_sb );   
-   
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_destroy( &ld->ld_msgid_mutex );
        ldap_pvt_thread_mutex_destroy( &ld->ld_conn_mutex );