From 659dafb7fbbc95fc6e15ca883121a39fdcd7a5b9 Mon Sep 17 00:00:00 2001
From: Quanah Gibson-Mount <quanah@openldap.org>
Date: Fri, 16 Apr 2010 00:18:29 +0000
Subject: [PATCH] use slab allocation

---
 servers/slapd/back-ldap/search.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c
index 30ac707718..a8b05326aa 100644
--- a/servers/slapd/back-ldap/search.c
+++ b/servers/slapd/back-ldap/search.c
@@ -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 ) {
-- 
GitLab