Fix memory leak (#300)
Free memory allocated to temp before returning from the function.
This commit is contained in:
parent
a5e07418df
commit
7cad778cc0
@ -558,6 +558,7 @@ void StandardCalculatorViewModel::HandleUpdatedOperandData(Command cmdenum)
|
|||||||
length = m_selectedExpressionLastData->Length() + 1;
|
length = m_selectedExpressionLastData->Length() + 1;
|
||||||
if (length > 50)
|
if (length > 50)
|
||||||
{
|
{
|
||||||
|
delete [] temp;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (; i < length; ++i)
|
for (; i < length; ++i)
|
||||||
|
Loading…
Reference in New Issue
Block a user