From f8303acba7b6131b1d057efa164ce5876af3033f Mon Sep 17 00:00:00 2001 From: Ismael Gomez Date: Sat, 17 Feb 2018 21:37:48 +0100 Subject: [PATCH] Fixed memory leak in logger_stdout --- lib/include/srslte/common/logger_stdout.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/include/srslte/common/logger_stdout.h b/lib/include/srslte/common/logger_stdout.h index 00e4ffa7a..b76faadaf 100644 --- a/lib/include/srslte/common/logger_stdout.h +++ b/lib/include/srslte/common/logger_stdout.h @@ -42,7 +42,10 @@ namespace srslte { { public: void log(std::string *msg) { - fprintf(stdout, "%s", msg->c_str()); + if (msg) { + fprintf(stdout, "%s", msg->c_str()); + delete msg; + } } };