Skip to content
Snippets Groups Projects
Commit 8cda8e5f authored by Howard Chu's avatar Howard Chu Committed by Quanah Gibson-Mount
Browse files

ITS#8050 fix ldap_get_option(LDAP_OPT_SESSION_REFCNT)

parent 2db31f6e
No related branches found
No related tags found
No related merge requests found
......@@ -371,7 +371,9 @@ ldap_get_option(
/* bad param */
break;
}
LDAP_MUTEX_LOCK( &ld->ld_ldcmutex );
* (int *) outvalue = ld->ld_ldcrefcnt;
LDAP_MUTEX_UNLOCK( &ld->ld_ldcmutex );
rc = LDAP_OPT_SUCCESS;
break;
......
......@@ -97,13 +97,14 @@ ldap_ld_free(
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 );
......@@ -123,7 +124,7 @@ ldap_ld_free(
next = lm->lm_next;
ldap_msgfree( lm );
}
if ( ld->ld_abandoned != NULL ) {
LDAP_FREE( ld->ld_abandoned );
ld->ld_abandoned = NULL;
......@@ -159,8 +160,8 @@ ldap_ld_free(
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;
......@@ -227,7 +228,6 @@ ldap_ld_free(
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
......@@ -235,7 +235,7 @@ ldap_ld_free(
#endif
LDAP_FREE( (char *) ld->ldc );
LDAP_FREE( (char *) ld );
return( err );
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment