public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-3701] Plug memory leak in attribute target_clones Date: Sun, 6 Nov 2022 00:53:27 +0000 (GMT) [thread overview] Message-ID: <20221106005327.D63083858D26@sourceware.org> (raw) https://gcc.gnu.org/g:07b0096e5b6749d88f5a22f694401abd6aaca551 commit r13-3701-g07b0096e5b6749d88f5a22f694401abd6aaca551 Author: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> Date: Thu Nov 3 21:52:51 2022 +0100 Plug memory leak in attribute target_clones It looks like there was some memory leak in the handling of attribute target_clones. Ok for trunk if testing passes? gcc/ChangeLog: * multiple_target.cc (expand_target_clones): Free memory. Signed-off-by: Bernhard Reutner-Fischer <aldot@gcc.gnu.org> Diff: --- gcc/multiple_target.cc | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index 67866a7c963..77e0f21dd05 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.cc @@ -390,19 +390,23 @@ expand_target_clones (struct cgraph_node *node, bool definition) for (i = 0; i < attrnum; i++) { char *attr = attrs[i]; - char *suffix = XNEWVEC (char, strlen (attr) + 1); - create_new_asm_name (attr, suffix); /* Create new target clone. */ tree attributes = make_attribute ("target", attr, DECL_ATTRIBUTES (node->decl)); + char *suffix = XNEWVEC (char, strlen (attr) + 1); + create_new_asm_name (attr, suffix); cgraph_node *new_node = create_target_clone (node, definition, suffix, attributes); + XDELETEVEC (suffix); if (new_node == NULL) - return false; + { + XDELETEVEC (attrs); + XDELETEVEC (attr_str); + return false; + } new_node->local = false; - XDELETEVEC (suffix); decl2_v = new_node->function_version (); if (decl2_v != NULL)
reply other threads:[~2022-11-06 0:53 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221106005327.D63083858D26@sourceware.org \ --to=aldot@gcc.gnu.org \ --cc=gcc-cvs@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).