]> git.sur5r.net Git - openldap/commitdiff
Don't leak SLAPI_RESCONTROLS when free'ing parameter block - these
authorLuke Howard <lukeh@openldap.org>
Tue, 16 Dec 2003 05:59:50 +0000 (05:59 +0000)
committerLuke Howard <lukeh@openldap.org>
Tue, 16 Dec 2003 05:59:50 +0000 (05:59 +0000)
are allocated by the plugin

servers/slapd/slapi/slapi_pblock.c

index c97880c5f60f8f61c2ed59a50b1e54021998bdb0..49431aabf6e55f61f740cde2f72b0afdc9620ca1 100644 (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 );