]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
diagnostics: fix memory leak of m_option_mgr
authorDavid Malcolm <dmalcolm@redhat.com>
Thu, 31 Oct 2024 16:24:55 +0000 (12:24 -0400)
committerDavid Malcolm <dmalcolm@redhat.com>
Thu, 31 Oct 2024 16:24:55 +0000 (12:24 -0400)
Fix some noise seen in "make selftest-valgrind".

gcc/ChangeLog:
* diagnostic.cc (diagnostic_context::finish): Delete and reset
m_option_mgr.

Signed-off-by: David Malcolm <dmalcolm@redhat.com>
gcc/diagnostic.cc

index 477214c15f2b575894c89e98195043bfa56b63e1..ecc4bd94eba199318211bb5ce280d0d07ed3e41c 100644 (file)
@@ -420,6 +420,9 @@ diagnostic_context::finish ()
       m_client_data_hooks = nullptr;
     }
 
+  delete m_option_mgr;
+  m_option_mgr = nullptr;
+
   delete m_urlifier;
   m_urlifier = nullptr;