From 428dddd74e4a2b64b44bccf64404bc2045c76f93 Mon Sep 17 00:00:00 2001 From: "Dirk-Jan C. Binnema" Date: Wed, 20 Oct 2021 23:06:28 +0300 Subject: [PATCH] lib/mu: fix a few leaks Thanks to valgrind --- lib/mu-msg-file.cc | 3 ++- lib/test-query.cc | 6 +++++- mu/test-mu-cmd.cc | 2 -- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/mu-msg-file.cc b/lib/mu-msg-file.cc index d5be3e0d..62db5581 100644 --- a/lib/mu-msg-file.cc +++ b/lib/mu-msg-file.cc @@ -1,5 +1,5 @@ /* -** Copyright (C) 2012-2020 Dirk-Jan C. Binnema +** Copyright (C) 2012-2021 Dirk-Jan C. Binnema ** ** This program is free software; you can redistribute it and/or modify it ** under the terms of the GNU General Public License as published by the @@ -73,6 +73,7 @@ Mu::mu_msg_file_destroy(MuMsgFile* self) g_free(self->_path); g_free(self->_maildir); + g_free(self->_sha1); g_free(self); } diff --git a/lib/test-query.cc b/lib/test-query.cc index c31667f5..7f587cce 100644 --- a/lib/test-query.cc +++ b/lib/test-query.cc @@ -37,8 +37,12 @@ static void test_query() { allow_warnings(); + char* tdir; + + tdir = test_mu_common_get_random_tmpdir(); + Store store{tdir, std::string{MU_TESTMAILDIR}, {}, {}}; + g_free(tdir); - Store store{test_mu_common_get_random_tmpdir(), std::string{MU_TESTMAILDIR}, {}, {}}; auto&& idx{store.indexer()}; g_assert_true(idx.start(Indexer::Config{})); diff --git a/mu/test-mu-cmd.cc b/mu/test-mu-cmd.cc index 37f27127..239ed97d 100644 --- a/mu/test-mu-cmd.cc +++ b/mu/test-mu-cmd.cc @@ -469,8 +469,6 @@ test_mu_extract_overwrite(void) if (g_test_verbose()) g_print("$ %s\n", cmdline); - return; // XXX fix tests - /* now, it should fail, because we don't allow overwrites * without --overwrite */ g_assert(g_spawn_command_line_sync(cmdline, &output, &erroutput, NULL, NULL));