diff --git a/src/diskio.cc b/src/diskio.cc index 3772f294..0fd69609 100644 --- a/src/diskio.cc +++ b/src/diskio.cc @@ -49,7 +49,7 @@ void clear_diskio_stats() { cur = stats.next; stats.next = stats.next->next; free_and_zero(cur->dev); - free(cur); + delete cur; } } diff --git a/src/imlib2.cc b/src/imlib2.cc index 227a4957..f6479f20 100644 --- a/src/imlib2.cc +++ b/src/imlib2.cc @@ -107,7 +107,7 @@ void cimlib_cleanup() { while (cur != nullptr) { last = cur; cur = last->next; - free(last); + delete last; } image_list_start = image_list_end = nullptr; } diff --git a/src/mail.cc b/src/mail.cc index 216c63f6..d4577279 100644 --- a/src/mail.cc +++ b/src/mail.cc @@ -249,8 +249,7 @@ static void update_mail_count(struct local_mail_s *mail) { /* . and .. are skipped */ if (dirent->d_name[0] != '.') { mail->mail_count++; - mailflags = static_cast( - malloc(sizeof(char) * strlen(strrchr(dirent->d_name, ',')))); + mailflags = strdup(dirent->d_name); if (mailflags == nullptr) { NORM_ERR("malloc"); return;