]> git.sur5r.net Git - openldap/commitdiff
use slab allocation
authorPierangelo Masarati <ando@openldap.org>
Mon, 12 Apr 2010 07:44:56 +0000 (07:44 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 12 Apr 2010 07:44:56 +0000 (07:44 +0000)
servers/slapd/back-ldap/search.c

index c8ccbed0ec2585e074eedde63dd5d80007983a3b..4bb3efbc1137f6884fdee8868ba1d5a0b11aae72 100644 (file)
@@ -195,7 +195,8 @@ ldap_back_search(
                for ( i = 0; !BER_BVISNULL( &op->ors_attrs[i].an_name ); i++ )
                        /* just count attrs */ ;
 
-               attrs = ch_malloc( ( i + 1 )*sizeof( char * ) );
+               attrs = op->o_tmpalloc( ( i + 1 )*sizeof( char * ),
+                       op->o_tmpmemctx );
                if ( attrs == NULL ) {
                        rs->sr_err = LDAP_NO_MEMORY;
                        rc = -1;
@@ -609,7 +610,7 @@ finish:;
        }
 
        if ( attrs ) {
-               ch_free( attrs );
+               op->o_tmpfree( attrs, op->o_tmpmemctx );
        }
 
        if ( lc != NULL ) {