diff --git a/src/cc/assets.cpp b/src/cc/assets.cpp index 3a94aef02..2de45f93e 100644 --- a/src/cc/assets.cpp +++ b/src/cc/assets.cpp @@ -511,10 +511,6 @@ std::string FinalizeCCTx(uint8_t evalcode,CMutableTransaction &mtx,CPubKey mypk, } } else fprintf(stderr,"FinalizeCCTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString().c_str()); } - if ( mycond != 0 ) - cc_free(mycond); - if ( othercond != 0 ) - cc_free(othercond); if ( totalinputs >= totaloutputs+2*txfee ) { change = totalinputs - (totaloutputs+txfee); @@ -561,6 +557,10 @@ std::string FinalizeCCTx(uint8_t evalcode,CMutableTransaction &mtx,CPubKey mypk, } } else fprintf(stderr,"FinalizeAssetTx couldnt find %s\n",mtx.vin[i].prevout.hash.ToString().c_str()); } + if ( mycond != 0 ) + cc_free(mycond); + if ( othercond != 0 ) + cc_free(othercond); std::string strHex = EncodeHexTx(mtx); if ( strHex.size() > 0 ) return(strHex);