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 <bstoeger@mail.tuwien.ac.at>
This commit is contained in:
Berthold Stoeger 2024-05-28 23:14:10 +02:00 committed by Michael Keller
parent e39b42df53
commit 64d4de4a1b

View file

@ -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);