public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mikael at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug fortran/108925] memory leak of gfc_get_namespace result Date: Mon, 06 Mar 2023 20:00:02 +0000 [thread overview] Message-ID: <bug-108925-4-VaXk9ilfOM@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-108925-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108925 --- Comment #5 from Mikael Morin <mikael at gcc dot gnu.org> --- This does NOT improve things: diff --git a/gcc/fortran/module.cc b/gcc/fortran/module.cc index 601497e0998..2d6c7b8ef73 100644 --- a/gcc/fortran/module.cc +++ b/gcc/fortran/module.cc @@ -5258,7 +5258,10 @@ read_cleanup (pointer_info *p) vtypes - their name is fine for a symtree and reduces the namespace pollution. */ st = gfc_find_symtree (ns->sym_root, p->u.rsym.sym->name); - if (!st) + if (st) + /* The symtree is reassigned below. */ + st->n.sym->refs--; + else st = gfc_new_symtree (&ns->sym_root, p->u.rsym.sym->name); }
next prev parent reply other threads:[~2023-03-06 20:00 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-02-24 12:32 [Bug fortran/108925] New: " rguenth at gcc dot gnu.org 2023-03-06 19:23 ` [Bug fortran/108925] " mikael at gcc dot gnu.org 2023-03-06 19:40 ` anlauf at gcc dot gnu.org 2023-03-06 19:47 ` mikael at gcc dot gnu.org 2023-03-06 19:52 ` anlauf at gcc dot gnu.org 2023-03-06 20:00 ` mikael at gcc dot gnu.org [this message] 2023-03-07 11:41 ` mikael at gcc dot gnu.org 2023-03-08 19:52 ` anlauf at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-108925-4-VaXk9ilfOM@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
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).