Fix memory leak in function benchMem

`speedPerRound` is allocated at the start of benchMem to collect per-round speeds,
but is never freed, causing a leak on each invocation.
This commit is contained in:
jinyaoguo 2025-05-25 15:21:23 -04:00
parent f9938c217d
commit 4618b255ea

View File

@ -739,6 +739,8 @@ static int benchMem(slice_collection_t dstBlocks, slice_collection_t srcBlocks,
/* BMK_benchTimedFn may not run exactly nbRounds iterations */
double speedAggregated =
aggregateData(speedPerRound, roundNb + 1, metricAggregatePref);
free(speedPerRound);
if (metricAggregatePref == fastest)
DISPLAY("Fastest Speed : %.1f MB/s \n", speedAggregated);
else