From: trevor_hansen Date: Sun, 9 Jan 2011 04:04:12 +0000 (+0000) Subject: Fix small memory leak. X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=a966ad35402a80257a463d08dea032bfb7c80124;p=francis%2Fstp.git Fix small memory leak. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1058 e59a4935-1847-0410-ae03-e826735625c1 --- diff --git a/src/simplifier/consteval.cpp b/src/simplifier/consteval.cpp index 97684b7..f8c4d5e 100644 --- a/src/simplifier/consteval.cpp +++ b/src/simplifier/consteval.cpp @@ -457,8 +457,6 @@ namespace BEEV case BVMOD: { assert(2==number_of_children); - CBV quotient = CONSTANTBV::BitVector_Create(inputwidth, true); - CBV remainder = CONSTANTBV::BitVector_Create(inputwidth, true); if (_bm->UserFlags.division_by_zero_returns_one_flag && CONSTANTBV::BitVector_is_empty(tmp1)) @@ -474,6 +472,8 @@ namespace BEEV } else { + CBV quotient = CONSTANTBV::BitVector_Create(inputwidth, true); + CBV remainder = CONSTANTBV::BitVector_Create(inputwidth, true); // tmp0 is dividend, tmp1 is the divisor All parameters //to BitVector_Div_Pos must be distinct unlike @@ -487,7 +487,9 @@ namespace BEEV if (0 != e) { - //error printing + CONSTANTBV::BitVector_Destroy(quotient); + CONSTANTBV::BitVector_Destroy(remainder); + //error printing if (_bm->counterexample_checking_during_refinement) { output = CONSTANTBV::BitVector_Create(inputwidth, true);