mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
Revert "Fix a memory leak in ExpressionParser.cpp"
This reverts commit cce809ac90
.
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.
This commit is contained in:
@ -549,10 +549,7 @@ ExpressionParseStatus ParseExpressionInner(std::string str, ControlFinder &finde
|
|||||||
Parser p(tokens, finder);
|
Parser p(tokens, finder);
|
||||||
status = p.Parse(&expr);
|
status = p.Parse(&expr);
|
||||||
if (status != EXPRESSION_PARSE_SUCCESS)
|
if (status != EXPRESSION_PARSE_SUCCESS)
|
||||||
{
|
|
||||||
delete expr;
|
|
||||||
return status;
|
return status;
|
||||||
}
|
|
||||||
|
|
||||||
*expr_out = expr;
|
*expr_out = expr;
|
||||||
return EXPRESSION_PARSE_SUCCESS;
|
return EXPRESSION_PARSE_SUCCESS;
|
||||||
|
Reference in New Issue
Block a user