From 39a9997fd0e84c343ed6a1248b66eebf148ea029 Mon Sep 17 00:00:00 2001 From: Evgeniy Dushistov Date: Sun, 7 Nov 2021 20:43:41 +0300 Subject: [PATCH] Fix usage of `free` for stack variable Based on warning from pvs static analyzer (https://habr.com/ru/company/pvs-studio/blog/586700/) --- src/common/log.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/log.cpp b/src/common/log.cpp index cd25edb4b..cfbfea1d5 100644 --- a/src/common/log.cpp +++ b/src/common/log.cpp @@ -213,7 +213,7 @@ static ALWAYS_INLINE void FormatLogMessageAndPrintW(const char* channelName, con callback(wmessage_buf, wmessage_buflen); if (wmessage_buf != wbuf) - std::free(wbuf); + std::free(wmessage_buf); if (message_buf != buf) std::free(message_buf);