From 64d4de4a1bd12ccfbe4580867e496cf9bf975b6d Mon Sep 17 00:00:00 2001 From: Berthold Stoeger Date: Tue, 28 May 2024 23:14:10 +0200 Subject: [PATCH] fix memory leak logfile_name was converted to std::string. Assigning a strdup()ed string to it will leak memory. Signed-off-by: Berthold Stoeger --- subsurface-downloader-main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsurface-downloader-main.cpp b/subsurface-downloader-main.cpp index a480cc4b3..d655c3c59 100644 --- a/subsurface-downloader-main.cpp +++ b/subsurface-downloader-main.cpp @@ -43,7 +43,7 @@ int main(int argc, char **argv) QStringList arguments = QCoreApplication::arguments(); // set a default logfile name for libdivecomputer so we always get a logfile - logfile_name = strdup("subsurface-downloader.log"); + logfile_name = "subsurface-downloader.log"; const char *default_directory = system_default_directory(); subsurface_mkdir(default_directory);