Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix a memory leak in ExpressionParser.cpp
Because there's a return here, expr should be deleted since it's not assigned to anything before returning.
  • Loading branch information
lioncash committed Aug 8, 2013
1 parent 72abe7c commit cce809a
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -549,7 +549,10 @@ ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finde
Parser p(tokens, finder);
status = p.Parse(&expr);
if (status != EXPRESSION_PARSE_SUCCESS)
{
delete expr;
return status;
}

*expr_out = expr;
return EXPRESSION_PARSE_SUCCESS;
Expand Down

0 comments on commit cce809a

Please sign in to comment.