From bd8e9da7863e60a115c219970c11153b94d147fa Mon Sep 17 00:00:00 2001 From: Mihailo Milenkovic Date: Tue, 12 Mar 2019 13:18:16 +0100 Subject: [PATCH] Fix memory leak in FinalizeCCTx (#1329) --- src/cc/CCtx.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/cc/CCtx.cpp b/src/cc/CCtx.cpp index 2b0893eb4..3e93b3462 100644 --- a/src/cc/CCtx.cpp +++ b/src/cc/CCtx.cpp @@ -290,6 +290,16 @@ std::string FinalizeCCTx(uint64_t CCmask,struct CCcontract_info *cp,CMutableTran cc_free(othercond3); if ( othercond4 != 0 ) cc_free(othercond4); + if ( othercond1of2 != 0 ) + cc_free(othercond1of2); + if ( othercond1of2tokens != 0 ) + cc_free(othercond1of2tokens); + if ( mytokenscond != 0 ) + cc_free(mytokenscond); + if ( mysingletokenscond != 0 ) + cc_free(mysingletokenscond); + if ( othertokenscond != 0 ) + cc_free(othertokenscond); std::string strHex = EncodeHexTx(mtx); if ( strHex.size() > 0 ) return(strHex);