From 4df7f4aaa16fdf99ba4810e971c49a23f42478a4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 8 Dec 2016 11:59:07 +0100 Subject: [PATCH] [poincare] Correct memory leaking issue Change-Id: Ide22a702f7a23b140cad7cd61f4543355b2de8f6 --- poincare/src/power.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/poincare/src/power.cpp b/poincare/src/power.cpp index 1f1136120..fa56424c3 100644 --- a/poincare/src/power.cpp +++ b/poincare/src/power.cpp @@ -40,13 +40,11 @@ Expression * Power::evaluateOnMatrixAndInteger(Matrix * m, Integer * i, Context& Expression * operands[2]; operands[0] = result; operands[1] = m; - Expression * next = new Product(operands, true); - /* We do not need to suppress next, as we suppress result and m is handle by - * another scope (TODO: something feels wrong. Check again) */ - Expression * newResult = next->evaluate(context); + Expression * product = new Product(operands, true); + Expression * newResult = product->evaluate(context); delete result; result = newResult; - delete next; + delete product; } return result; }