From 20e6ed102e03880dc702ba25d79845a431896d9b Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Wed, 21 Feb 2018 15:50:22 +0100 Subject: [PATCH] fix when accessing uninitialized file --- lib/src/common/logger_file.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/src/common/logger_file.cc b/lib/src/common/logger_file.cc index 25155da08..a911ae20e 100644 --- a/lib/src/common/logger_file.cc +++ b/lib/src/common/logger_file.cc @@ -35,6 +35,7 @@ namespace srslte{ logger_file::logger_file() :inited(false) + ,logfile(NULL) ,not_done(true) ,cur_length(0) ,max_length(0) @@ -46,7 +47,9 @@ logger_file::~logger_file() { if(inited) { wait_thread_finish(); flush(); - fclose(logfile); + if (logfile) { + fclose(logfile); + } } }