mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-03-12 14:46:49 +01:00
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.
This commit is contained in:
parent
72abe7c654
commit
cce809ac90
@ -549,7 +549,10 @@ 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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user