Don't leak SLAPI_RESCONTROLS when free'ing parameter block - these

are allocated by the plugin
This commit is contained in:
Luke Howard 2003-12-16 05:59:50 +00:00
parent a736f237f8
commit 0bcddbc908

View file

@ -400,6 +400,7 @@ slapi_pblock_destroy( Slapi_PBlock* pb )
{
#if defined(LDAP_SLAPI)
char *str = NULL;
LDAPControl **rescontrols = NULL;
get( pb, SLAPI_CONN_DN,(void **)&str );
if ( str != NULL ) {
@ -436,6 +437,12 @@ slapi_pblock_destroy( Slapi_PBlock* pb )
str = NULL;
}
get( pb, SLAPI_RESCONTROLS, (void **)&rescontrols );
if ( rescontrols != NULL ) {
ldap_controls_free( rescontrols );
rescontrols = NULL;
}
ldap_pvt_thread_mutex_destroy( &pb->pblockMutex );
ch_free( pb );