[Date Prev][Date Next]
[Chronological]
[Thread]
[Top]
Re: (ITS#8011) few mistakes in lmdb-backend
leo@yuriev.ru wrote:
> @@ -1265,8 +1264,10 @@ static void *search_stack( Operation *op )
> }
>
> if ( !ret ) {
> - ret = ch_malloc( mdb->mi_search_stack_depth * MDB_IDL_UM_SIZE
> - * sizeof( ID ) );
> + size_t case_stack = mdb->mi_search_stack_depth * MDB_IDL_UM_SIZE * sizeof( ID );
> + size_t case_sctmp = MDB_IDL_UM_SIZE * sizeof( ID2 );
> + size_t size = (case_stack > case_sctmp) ? case_stack : case_sctmp;
> + ret = ch_malloc( size );
> if ( op->o_threadctx ) {
> ldap_pvt_thread_pool_setkey( op->o_threadctx, (void *)search_stack,
> ret, search_stack_free, NULL, NULL );
>
Unnecessary.
--
-- Howard Chu
CTO, Symas Corp. http://www.symas.com
Director, Highland Sun http://highlandsun.com/hyc/
Chief Architect, OpenLDAP http://www.openldap.org/project/