#16 Current parser has memory bug

resolved
closed-fixed
htsearch (60)
5
2001-03-12
2001-03-04
Geoff Hutchison
No

From: rwankar@iname.com
Full_Name: Ravindra Wankar

When there is a parser error, (e.g. syntax error in
boolean expression), errorMsg is set in htsearch.cc

if (parser->hadError())
errorMsg = parser->getErrorMessage();
delete parser;

The delete statement causes memory allocated for the
string to be freed, so this needs to be changed

errorMsg = strdup(parser->getErrorMessage());

and later freed.

Discussion

  • Logged In: YES
    user_id=21420

    This is fixed in the current 3.2 code. If we decide to do a
    3.1.6 release, it should be backported.

     
    • milestone: --> resolved
    • assigned_to: nobody --> ghutchis
    • status: open --> closed-fixed
     
  • Logged In: YES
    user_id=149687

    This is not an issue in the current 3.1.5 code. It was introduced by the collections patch, I think.
    The errorMsg object should probably be implemented using the String class in 3.2, rather than
    messing around with strdup().

     
  • Logged In: YES
    user_id=149687

    This is not an issue in the current 3.1.5 code. It was introduced by the collections patch, I think.
    The errorMsg object should probably be implemented using the String class in 3.2, rather than
    messing around with strdup().