Skip to main content.
home | support | download

Back to List Archive

memleak when setting & resetting search limits

From: Antony Dovgal <antony(at)not-real.zend.com>
Date: Tue Jan 30 2007 - 16:24:38 GMT
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.

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--
Received on Tue Jan 30 08:24:43 2007