From c4aa2bc64c145f57adfec20a97a6a709f1935517 Mon Sep 17 00:00:00 2001 From: saturneric Date: Mon, 14 Sep 2026 22:33:21 +0200 Subject: fix(email): free verification error string - release error_string on successful region verification - prevent a per-region memory leak confirmed by ASan --- src/m_email/EMailBasicGpgOpera.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src') diff --git a/src/m_email/EMailBasicGpgOpera.cpp b/src/m_email/EMailBasicGpgOpera.cpp index 92001d3..c8bfeca 100644 --- a/src/m_email/EMailBasicGpgOpera.cpp +++ b/src/m_email/EMailBasicGpgOpera.cpp @@ -1180,6 +1180,12 @@ auto VerifyOneRegion(int channel, const QByteArray& raw, const auto err = s->gpgme_error; const auto capsule_id = UDUP(s->capsule_id); + // Reclaimed on the SUCCESS path too. Every other result site in this file + // takes error_string; this one did not, so a successful verification leaked + // it once per signed region -- confirmed by ASan, not by inspection. The + // opaque-result-handle rework removes the whole class by leaving no + // per-field free to forget; until then this is the missing line. + UDUP(s->error_string); GFGpgFreeResult(s->gpgme_verify_result); GFFreeMemory(s); -- cgit