diff options
author | Yann Collet <yann.collet.73@gmail.com> | 2015-04-08 08:20:21 (GMT) |
---|---|---|
committer | Yann Collet <yann.collet.73@gmail.com> | 2015-04-08 08:20:21 (GMT) |
commit | 327cb04f44a650afd3907701513b1c2e851a3b45 (patch) | |
tree | 0fb662c30939d781a313d9ff9bb0613ebbca0d00 | |
parent | 43e053513bb2386b526daad5621e29a817663691 (diff) | |
download | lz4-327cb04f44a650afd3907701513b1c2e851a3b45.zip lz4-327cb04f44a650afd3907701513b1c2e851a3b45.tar.gz lz4-327cb04f44a650afd3907701513b1c2e851a3b45.tar.bz2 |
minor memory leak fix and test
-rw-r--r-- | programs/Makefile | 1 | ||||
-rw-r--r-- | programs/lz4cli.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/programs/Makefile b/programs/Makefile index 3ca46d7..9585c9f 100644 --- a/programs/Makefile +++ b/programs/Makefile @@ -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) diff --git a/programs/lz4cli.c b/programs/lz4cli.c index 888f21e..2870c97 100644 --- a/programs/lz4cli.c +++ b/programs/lz4cli.c @@ -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) |