From 8901dcdc9db3ea5d47900be903dfdb5070dc6b21 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sun, 28 Jun 2015 21:53:42 -0800 Subject: [PATCH] removed one malloc --- programs/lz4io.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/programs/lz4io.c b/programs/lz4io.c index d92634a..be2dc5d 100644 --- a/programs/lz4io.c +++ b/programs/lz4io.c @@ -1013,6 +1013,7 @@ int LZ4IO_decompressFilename(const char* input_filename, const char* output_file } +#define MAXSUFFIXSIZE 8 int LZ4IO_decompressMultipleFilenames(const char** inFileNamesTable, int ifntSize, const char* suffix) { int i; @@ -1021,17 +1022,18 @@ int LZ4IO_decompressMultipleFilenames(const char** inFileNamesTable, int ifntSiz char* outFileName = (char*)malloc(FNSPACE); size_t ofnSize = FNSPACE; const size_t suffixSize = strlen(suffix); - char* ifnSuffix = (char*)malloc(suffixSize + 1); + const char* suffixPtr; dRess_t ress; + if (outFileName==NULL) exit(1); /* not enough memory */ ress = LZ4IO_createDResources(); for (i=0; i