From 23906257323763be26d1a067cadaef92b4a616c8 Mon Sep 17 00:00:00 2001 From: Tim Wojtulewicz Date: Fri, 4 Apr 2025 15:06:14 -0700 Subject: [PATCH] Fix a potential memory leak in Debug function --- src/Debug.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Debug.cc b/src/Debug.cc index 9f1a9b28b2..f4e12bbb61 100644 --- a/src/Debug.cc +++ b/src/Debug.cc @@ -160,7 +160,7 @@ int TraceState::LogTrace(const char* fmt, ...) { if ( ! loc.filename ) { static constexpr const char str[] = ""; - loc.filename = util::copy_string(str, std::size(str) - 1); + loc.filename = str; loc.last_line = 0; } @@ -679,7 +679,7 @@ string get_context_description(const Stmt* stmt, const Frame* frame) { loc = *stmt->GetLocationInfo(); else { static constexpr const char str[] = ""; - loc.filename = util::copy_string(str, std::size(str) - 1); + loc.filename = str; loc.last_line = 0; }