no need to track tableBuf
free() is compatible with NULL, let's free() unconditionnally
This commit is contained in:
+1
-9
@@ -566,7 +566,6 @@ int main(int argCount, const char* argv[])
|
||||
nextArgumentIsMaxDict = 0,
|
||||
nextArgumentIsDictID = 0,
|
||||
nextArgumentsAreFiles = 0,
|
||||
isTableBufferBased = 0,
|
||||
nextEntryIsDictionary = 0,
|
||||
operationResult = 0,
|
||||
separateFiles = 0,
|
||||
@@ -827,7 +826,6 @@ int main(int argCount, const char* argv[])
|
||||
|
||||
concatenatedTables = UTIL_concatenateTwoTables(curTable, extendedTable);
|
||||
if (!concatenatedTables) {
|
||||
if (!isTableBufferBased) curTable->buf = NULL;
|
||||
UTIL_freeFileNamesTable(curTable);
|
||||
UTIL_freeFileNamesTable(extendedTable);
|
||||
CLEAN_RETURN(badusage(programName));
|
||||
@@ -842,8 +840,6 @@ int main(int argCount, const char* argv[])
|
||||
concatenatedTables->buf = NULL;
|
||||
UTIL_freeFileNamesTable(concatenatedTables);
|
||||
|
||||
isTableBufferBased = 1; /* file names are now in heap */
|
||||
|
||||
continue;
|
||||
}
|
||||
/* fall-through, will trigger bad_usage() later on */
|
||||
@@ -1253,11 +1249,7 @@ int main(int argCount, const char* argv[])
|
||||
_end:
|
||||
FIO_freePreferences(prefs);
|
||||
|
||||
if(filenameTable) {
|
||||
if(isTableBufferBased && tableBuf){
|
||||
free(tableBuf);
|
||||
}
|
||||
}
|
||||
free(tableBuf);
|
||||
|
||||
if (main_pause) waitEnter();
|
||||
#ifdef UTIL_HAS_CREATEFILELIST
|
||||
|
||||
Reference in New Issue
Block a user