Skip to main content.
home | support | download

Back to List Archive

Re: memleak when setting & resetting search limits

From: Bill Moseley <moseley(at)not-real.hank.org>
Date: Tue Jan 30 2007 - 22:12:11 GMT
On Tue, Jan 30, 2007 at 08:21:18AM -0800, Antony Dovgal wrote:
> This is a multi-part message in MIME format.
> --------------010308020804050007070401
> Content-Type: text/plain; charset=KOI8-R; format=flowed
> Content-Transfer-Encoding: 7bit
> 
> Hello all.
> 
> If one calls SwishSetSearchLimit() and then frees the search object, SwishResetSearchLimit() 
> function will not free previously allocated search->limit_params because search->limits_prepared is 0.
> search->limits_prepared supposed to be set in Prepare_PropLookup(), but it was not called.

You are probably more familiar with that code then I am at this time,
but should that code you removed just be moved below the
ClearLimitParams() part?


> 
> Please review the patch attached, which fixes the problem.
> 
> -- 
> Wbr, 
> Antony Dovgal
> 
> --------------010308020804050007070401
> Content-Type: text/plain;
>  name="reset_leak.diff.txt"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: inline;
>  filename="reset_leak.diff.txt"
> 
> Index: src/proplimit.c
> ===================================================================
> RCS file: /cvsroot/swishe/swish-e/src/proplimit.c,v
> retrieving revision 1.48
> diff -u -p -d -r1.48 proplimit.c
> --- src/proplimit.c	12 May 2005 15:41:05 -0000	1.48
> +++ src/proplimit.c	30 Jan 2007 16:18:52 -0000
> @@ -152,10 +152,6 @@ void SwishResetSearchLimit( SEARCH_OBJEC
>      int         metaID;
>      
>  
> -    if ( !srch->limits_prepared )
> -        return;
> -
> -
>      /* Free up the input parameters */
>      ClearLimitParams( srch->limit_params );
>      srch->limit_params = NULL;
> 
> --------------010308020804050007070401--
> 

-- 
Bill Moseley
moseley@hank.org

Unsubscribe from or help with the swish-e list: 
   http://swish-e.org/Discussion/

Help with Swish-e:
   http://swish-e.org/current/docs
   swish-e@sunsite.berkeley.edu
Received on Tue Jan 30 14:12:11 2007