/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2013 The OpenLDAP Foundation.
+ * Copyright 1998-2017 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
if ( ld->ld_referrals != NULL) {
LDAP_VFREE(ld->ld_referrals);
ld->ld_referrals = NULL;
- }
+ }
LDAP_MUTEX_UNLOCK( &ld->ld_ldcmutex );
LDAP_FREE( (char *) ld );
return( err );
}
/* This ld is the last thread. */
+ LDAP_MUTEX_UNLOCK( &ld->ld_ldcmutex );
/* free LDAP structure and outstanding requests/responses */
LDAP_MUTEX_LOCK( &ld->ld_req_mutex );
next = lm->lm_next;
ldap_msgfree( lm );
}
-
+
if ( ld->ld_abandoned != NULL ) {
LDAP_FREE( ld->ld_abandoned );
ld->ld_abandoned = NULL;
if ( ld->ld_referrals != NULL) {
LDAP_VFREE(ld->ld_referrals);
ld->ld_referrals = NULL;
- }
-
+ }
+
if ( ld->ld_selectinfo != NULL ) {
ldap_free_select_info( ld->ld_selectinfo );
ld->ld_selectinfo = NULL;
ldap_pvt_thread_mutex_destroy( &ld->ld_res_mutex );
ldap_pvt_thread_mutex_destroy( &ld->ld_abandon_mutex );
ldap_pvt_thread_mutex_destroy( &ld->ld_ldopts_mutex );
- ldap_pvt_thread_mutex_unlock( &ld->ld_ldcmutex );
ldap_pvt_thread_mutex_destroy( &ld->ld_ldcmutex );
#endif
#ifndef NDEBUG
#endif
LDAP_FREE( (char *) ld->ldc );
LDAP_FREE( (char *) ld );
-
+
return( err );
}