public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-3636] diagnostics: Delete config pointer before overwriting it
@ 2023-09-02 11:00 Mikael Morin
  0 siblings, 0 replies; only message in thread
From: Mikael Morin @ 2023-09-02 11:00 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:474473f0425b404cd3ce15e73844de4608ac4ba7

commit r14-3636-g474473f0425b404cd3ce15e73844de4608ac4ba7
Author: Mikael Morin <mikael@gcc.gnu.org>
Date:   Sat Sep 2 12:55:25 2023 +0200

    diagnostics: Delete config pointer before overwriting it
    
    Delete m_client_data_hooks before it is reassigned in
    tree_diagnostics_defaults.  This fixes a small memory leak in the fortran
    frontend, which restores the diagnostics configurations to their default
    values with a call to tree_diagnostics_defaults at the end of the main parse
    hook.
    
    gcc/ChangeLog:
    
            * tree-diagnostic.cc (tree_diagnostics_defaults): Delete allocated
            pointer before overwriting it.

Diff:
---
 gcc/tree-diagnostic.cc | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gcc/tree-diagnostic.cc b/gcc/tree-diagnostic.cc
index 731e3559cd81..d2f6637b6d95 100644
--- a/gcc/tree-diagnostic.cc
+++ b/gcc/tree-diagnostic.cc
@@ -377,5 +377,6 @@ tree_diagnostics_defaults (diagnostic_context *context)
   context->print_path = default_tree_diagnostic_path_printer;
   context->make_json_for_path = default_tree_make_json_for_path;
   context->set_locations_cb = set_inlining_locations;
+  delete context->m_client_data_hooks;
   context->m_client_data_hooks = make_compiler_data_hooks ();
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-09-02 11:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-02 11:00 [gcc r14-3636] diagnostics: Delete config pointer before overwriting it Mikael Morin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).