Fix memory leak in large tx benchmark

This commit is contained in:
Jack Grigg 2016-06-29 11:45:47 +12:00
parent cfd806e161
commit c2e092f29e
1 changed files with 1 additions and 1 deletions

View File

@ -231,6 +231,7 @@ processblock:
} }
double ret = timer_stop(); double ret = timer_stop();
delete pblocktemplate;
if (!testValidate) if (!testValidate)
return ret; return ret;
@ -238,7 +239,6 @@ processblock:
mempool.addUnchecked(hash, CTxMemPoolEntry(mtx2, 11, GetTime(), 111.0, 11)); mempool.addUnchecked(hash, CTxMemPoolEntry(mtx2, 11, GetTime(), 111.0, 11));
// 4) Call CreateNewBlock (which itself calls TestBlockValidity) // 4) Call CreateNewBlock (which itself calls TestBlockValidity)
delete pblocktemplate;
pblocktemplate = CreateNewBlock(scriptDummy); pblocktemplate = CreateNewBlock(scriptDummy);
pblock = &pblocktemplate->block; pblock = &pblocktemplate->block;