CoverityFix-CID:1393984 Resource Leak 47/20247/1
Nimish Kapoor [Tue, 10 Jul 2018 18:24:10 +0000 (23:24 +0530)]
Change-Id: I78f665cca71dbac39528e8b3632e3567cc4a8557

scilab/modules/ast/src/cpp/analysis/ConstantVisitor.cpp

index e04a221..8825a61 100644 (file)
@@ -218,12 +218,14 @@ void ConstantVisitor::visit(ast::CallExp & e)
                             ret = res.front().getConstant().getDblValue(val);
                             if (ret == 0)
                             {
+                                delete exps;
                                 return;
                             }
                             exps->push_back(new ast::DoubleExp(e.getLocation(), val));
                             ret = res.back().getConstant().getDblValue(val);
                             if (ret == 0)
                             {
+                                delete exps;
                                 return;
                             }
                             exps->push_back(new ast::DoubleExp(e.getLocation(), val));