public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: vladimir.mezentsev@oracle.com
To: binutils@sourceware.org
Cc: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>
Subject: [PATCH] gprofng: fix -Wuse-after-free warning
Date: Wed, 13 Dec 2023 17:54:22 -0800	[thread overview]
Message-ID: <20231214015422.2289661-1-vladimir.mezentsev@oracle.com> (raw)

From: Vladimir Mezentsev <vladimir.mezentsev@oracle.com>

Removed incorrect unnecessary code.

gprofng/ChangeLog
2023-12-13  Vladimir Mezentsev  <vladimir.mezentsev@oracle.com>

	* src/collctrl.cc (set_synctrace): Fix -Wuse-after-free warning.
---
 gprofng/src/collctrl.cc | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/gprofng/src/collctrl.cc b/gprofng/src/collctrl.cc
index 5d68b689a64..aeff5a0336c 100644
--- a/gprofng/src/collctrl.cc
+++ b/gprofng/src/collctrl.cc
@@ -1081,10 +1081,6 @@ Coll_Ctrl::set_synctrace (const char *string)
   if (*endchar != 0 || tval < 0)
     {
       free (val);
-      /* invalid setting */
-      /* restore the comma, if it was zeroed out */
-      if (comma_p != NULL)
-	*comma_p = ',';
       return dbe_sprintf (GTXT ("Unrecognized synchronization tracing threshold `%s'\n"), string);
     }
   free (val);
-- 
2.31.1


                 reply	other threads:[~2023-12-14  1:54 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=20231214015422.2289661-1-vladimir.mezentsev@oracle.com \
    --to=vladimir.mezentsev@oracle.com \
    --cc=binutils@sourceware.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: link
Be 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).