Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "Fix a memory leak in ExpressionParser.cpp"
This reverts commit cce809a.

The code was actually correct: "expr" is never allocated when an error is
returned. This means when the expression parser fails, deleting "expr" means
deleting an uninitialized pointer.
  • Loading branch information
delroth committed Aug 9, 2013
1 parent 90d454d commit 0aa9308
Showing 1 changed file with 0 additions and 3 deletions.
Expand Up @@ -549,10 +549,7 @@ 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 0aa9308

Please sign in to comment.