fixed leak issue

This commit is contained in:
Yann Collet 2015-11-25 15:26:55 +01:00
parent 785b5ecc54
commit d3cb690156
2 changed files with 3 additions and 1 deletions

View File

@ -108,6 +108,8 @@ size_t ZBUFF_freeCCtx(ZBUFF_CCtx* zbc)
{ {
if (zbc==NULL) return 0; /* support free on NULL */ if (zbc==NULL) return 0; /* support free on NULL */
ZSTD_freeCCtx(zbc->zc); ZSTD_freeCCtx(zbc->zc);
free(zbc->inBuff);
free(zbc->outBuff);
free(zbc); free(zbc);
return 0; return 0;
} }

View File

@ -234,7 +234,7 @@ valgrindTest: zstd datagen fuzzer fullbench
./datagen -g16KB > tmp ./datagen -g16KB > tmp
valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp $(VOID) valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp $(VOID)
./datagen -g2930KB > tmp ./datagen -g2930KB > tmp
valgrind --leak-check=yes --error-exitcode=1 ./zstd -4 -vf tmp $(VOID) valgrind --leak-check=yes --error-exitcode=1 ./zstd -5 -vf tmp $(VOID)
./datagen -g64MB > tmp ./datagen -g64MB > tmp
valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp $(VOID) valgrind --leak-check=yes --error-exitcode=1 ./zstd -vf tmp $(VOID)
@rm tmp @rm tmp