message: fix some error paths

This commit is contained in:
Dirk-Jan C. Binnema
2026-03-07 15:48:30 +02:00
committed by Seth Ladygo
parent d8d02b6d6a
commit 5e9cdc6654
2 changed files with 13 additions and 9 deletions

View File

@ -1,5 +1,5 @@
/*
** Copyright (C) 2022-2024 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
** Copyright (C) 2022-2026 Dirk-Jan C. Binnema <djcb@djcbsoftware.nl>
**
** 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
@ -659,8 +659,8 @@ doc_add_list_post(Document& doc, const MimeMessage& mime_msg)
/* some mailing lists do not set the reply-to; see pull #1278. So for
* those cases, check the List-Post address and use that instead */
GMatchInfo* minfo;
GRegex* rx;
GMatchInfo* minfo{};
GRegex* rx{};
const auto list_post{mime_msg.header("List-Post")};
if (!list_post)
return;
@ -676,7 +676,9 @@ doc_add_list_post(Document& doc, const MimeMessage& mime_msg)
g_free(address);
}
g_match_info_free(minfo);
if (minfo)
g_match_info_free(minfo);
g_regex_unref(rx);
doc.add_extra_contacts(":list-post", contacts);