From 0bcddbc9082758a37dc85fb9dc723326d333cb7d Mon Sep 17 00:00:00 2001 From: Luke Howard Date: Tue, 16 Dec 2003 05:59:50 +0000 Subject: [PATCH] Don't leak SLAPI_RESCONTROLS when free'ing parameter block - these are allocated by the plugin --- servers/slapd/slapi/slapi_pblock.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/servers/slapd/slapi/slapi_pblock.c b/servers/slapd/slapi/slapi_pblock.c index c97880c5f6..49431aabf6 100644 --- a/servers/slapd/slapi/slapi_pblock.c +++ b/servers/slapd/slapi/slapi_pblock.c @@ -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 ); -- 2.39.5