minor memory leak fix and test

This commit is contained in:
Yann Collet 2015-04-08 09:20:21 +01:00
parent 43e053513b
commit 327cb04f44
2 changed files with 7 additions and 1 deletions

View File

@ -250,6 +250,7 @@ test-mem: lz4 datagen fuzzer frametest fullbench
./datagen -g16MB > tmp
valgrind --leak-check=yes ./lz4 -9 -B5D -f tmp tmp2
valgrind --leak-check=yes ./lz4 -t tmp2
valgrind --leak-check=yes ./lz4 -bi1 tmp
valgrind --leak-check=yes ./fullbench -i1 tmp
./datagen -g256MB > tmp
valgrind --leak-check=yes ./lz4 -B4D -f -vq tmp $(VOID)

View File

@ -470,7 +470,12 @@ int main(int argc, char** argv)
if (!strcmp(input_filename, stdinmark) && IS_CONSOLE(stdin) ) badusage();
/* Check if benchmark is selected */
if (bench) return BMK_benchFiles(inFileNames, ifnIdx, cLevel);
if (bench)
{
int bmkResult = BMK_benchFiles(inFileNames, ifnIdx, cLevel);
free(inFileNames);
return bmkResult;
}
/* No output filename ==> try to select one automatically (when possible) */
while (!output_filename)