public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
From: Alan Modra <amodra@sourceware.org>
To: bfd-cvs@sourceware.org
Subject: [binutils-gdb] Re: objcopy write_debugging_info memory leaks
Date: Thu,  6 Apr 2023 12:00:14 +0000 (GMT)	[thread overview]
Message-ID: <20230406120014.7C4AB3856DD2@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=11aa9f628e28c077c860480571c152e07e6a4938

commit 11aa9f628e28c077c860480571c152e07e6a4938
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Apr 6 21:25:22 2023 +0930

    Re: objcopy write_debugging_info memory leaks
    
    Oops, tried to free too much
    
            * wrstabs.c (write_stabs_in_sections_debugging_info): Don't
            free strings.

Diff:
---
 binutils/wrstabs.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/binutils/wrstabs.c b/binutils/wrstabs.c
index b676374558b..234a96f98a3 100644
--- a/binutils/wrstabs.c
+++ b/binutils/wrstabs.c
@@ -464,7 +464,7 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
 					bfd_size_type *pstringsize)
 {
   struct stab_write_handle info;
-  struct string_hash_entry *h, *hnext;
+  struct string_hash_entry *h;
   bfd_byte *p;
   bool ret;
 
@@ -535,11 +535,6 @@ write_stabs_in_sections_debugging_info (bfd *abfd, void *dhandle,
   free (info.symbols);
   ret = false;
  out:
-  for (h = info.strings; h != NULL; h = hnext)
-    {
-      hnext = h->next;
-      free (h);
-    }
   while (info.type_stack != NULL)
     {
       struct stab_type_stack *s = info.type_stack;

                 reply	other threads:[~2023-04-06 12:00 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=20230406120014.7C4AB3856DD2@sourceware.org \
    --to=amodra@sourceware.org \
    --cc=bfd-cvs@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).