From fe2007b095aed43490c08ef8f4186bd2093d3a3d Mon Sep 17 00:00:00 2001 From: Deukhoofd Date: Sat, 25 May 2019 12:01:25 +0200 Subject: [PATCH] Fix memory leak on error --- src/Evaluator/BinaryEvaluation.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Evaluator/BinaryEvaluation.cpp b/src/Evaluator/BinaryEvaluation.cpp index 7a723c6..eb6ef5e 100644 --- a/src/Evaluator/BinaryEvaluation.cpp +++ b/src/Evaluator/BinaryEvaluation.cpp @@ -23,6 +23,8 @@ NumericEvalValue* Evaluator::EvaluateIntegerBinary(BoundBinaryExpression *expres result = leftValue -> operator/ (rightValue); break; default: + delete leftValue; + delete rightValue; throw EvaluationException("Can't evaluate operation to numeric"); } delete leftValue;