From 5e206fdd5370d5ed8c7fcf49ba9abad9d0850ed0 Mon Sep 17 00:00:00 2001 From: Ahmed Abdellah Date: Thu, 24 Oct 2019 14:21:01 +0100 Subject: [PATCH] fixing some warning --- programs/util.c | 2 +- programs/util.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/util.c b/programs/util.c index 74b4decc9..277b0cd5c 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 f126246be..cb01fcefe 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;