diff --git a/programs/util.c b/programs/util.c index 74b4decc..277b0cd5 100644 --- a/programs/util.c +++ b/programs/util.c @@ -296,7 +296,7 @@ void UTIL_freeFileNamesTable(FileNamesTable* table) { free(table->fileNames); } - if(table->buf) { + if(table && table->buf) { free(table->buf); } diff --git a/programs/util.h b/programs/util.h index f126246b..cb01fcef 100644 --- a/programs/util.h +++ b/programs/util.h @@ -151,8 +151,8 @@ int UTIL_readLineFromFile(char* buf, size_t len, FILE* file); /*Note: tableSize is denotes the total capacity of table*/ typedef struct { - const char** fileNames; - char* buf; + const char** fileNames = NULL; + char* buf = NULL; size_t tableSize; } FileNamesTable;