From 3d418776f016e1682408afa995dc03e540791d60 Mon Sep 17 00:00:00 2001 From: Patrick Lipka Date: Mon, 2 May 2022 15:10:16 +0200 Subject: [PATCH] Fixed missing delete of month_tmp in ignore_worktime case --- src/project.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/project.cpp b/src/project.cpp index 09aacf7..70186e5 100644 --- a/src/project.cpp +++ b/src/project.cpp @@ -147,17 +147,14 @@ void ProjectList::load(std::string file_name, bool ignore_worktimes){ size_t month_len; if (!legacy_mode){ // read month string from file - inf.read((char*) &month_len,sizeof(size_t)); char *month_tmp = new char[month_len+1]; inf.read(month_tmp,month_len); - if(!ignore_worktimes){ - month_tmp[month_len] = '\0'; - month = month_tmp; - delete [] month_tmp; - }else{ - month=get_date(); - } + month_tmp[month_len] = '\0'; + month = month_tmp; + delete [] month_tmp; + + if (ignore_worktimes) month=get_date(); } inf.read((char*) &num_projects,sizeof(int));