Changeset 1907

Show
Ignore:
Timestamp:
02/07/07 14:42:37 (1 year ago)
Author:
moseley
Message:

Patch provided by Antony Dovgal Jan 31.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • swish-e/trunk/pod/CHANGES.pod

    r1906 r1907  
    1010 
    1111=over 4 
     12 
     13=item Patched leaks 
     14 
     15Anthony Dovgal patched two leaks.  One when there's a failure to 
     16open a file the file name was not freed. 
     17 
     18SwishSetSearchLimit() was nulling the search limits when an error was 
     19found in the parameters, but not freeing the existing limits. 
    1220 
    1321=item Leak in SwishResetSearchLimit 
     
    2129relevant properties of the search object. 
    2230Patch provided by Antony Dovgal. 
    23  
    2431 
    2532 
  • swish-e/trunk/src/db_native.c

    r1812 r1907  
    535535    { 
    536536        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the property file \"%s\": ", s); 
     537        efree(s); 
    537538        return (void *) DB; 
    538539    } 
     
    550551    { 
    551552        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the btree file \"%s\": ", s); 
     553        efree(s); 
    552554        return (void *) DB; 
    553555    } 
     
    566568    { 
    567569        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the presorted index file \"%s\": ", s); 
     570        efree(s); 
    568571        return (void *) DB; 
    569572    } 
     
    582585    { 
    583586        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the worddata file \"%s\": ", s); 
     587        efree(s); 
    584588        return (void *) DB; 
    585589    } 
     
    598602    { 
    599603        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the hashfile file \"%s\": ", s); 
     604        efree(s); 
    600605        return (void *) DB; 
    601606    } 
     
    614619    { 
    615620        set_progerrno(INDEX_FILE_ERROR, DB->sw, "Couldn't open the array file \"%s\": ", s); 
     621        efree(s); 
    616622        return (void *) DB; 
    617623    } 
  • swish-e/trunk/src/proplimit.c

    r1903 r1907  
    240240int SwishSetSearchLimit(SEARCH_OBJECT *srch, char *propertyname, char *low, char *hi) 
    241241{ 
     242    LIMIT_PARAMS *params; 
    242243    reset_lasterror( srch->sw ); 
    243244     
     
    248249    } 
    249250 
    250     srch->limit_params = setlimit_params( srch->sw, srch->limit_params, propertyname, low, hi ); 
     251    /* Add new limit parameter to list */ 
     252    params  = setlimit_params( srch->sw, srch->limit_params, propertyname, low, hi ); 
     253 
     254    /* Only reset list if no error */ 
     255    if ( params ) 
     256        srch->limit_params = params; 
     257 
     258 
    251259    return ( srch->sw->lasterror == 0 ); 
    252  
    253260} 
    254261