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] vms write_archive memory leaks
Date: Thu, 15 Jun 2023 02:42:50 +0000 (GMT)	[thread overview]
Message-ID: <20230615024250.06CC23858298@sourceware.org> (raw)

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

commit 6a28a3c20044db82f86aad208497e2c8f6557f93
Author: Alan Modra <amodra@gmail.com>
Date:   Thu Jun 15 10:02:31 2023 +0930

    vms write_archive memory leaks
    
    This fixes two memory leaks in the vms archive handling.
    
            * vms-lib.c (_bfd_vms_lib_build_map): Free input symbols.
            (_bfd_vms_lib_write_archive_contents): Free archive map symbols.

Diff:
---
 bfd/vms-lib.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/bfd/vms-lib.c b/bfd/vms-lib.c
index ab938768ebe..298e959b8b9 100644
--- a/bfd/vms-lib.c
+++ b/bfd/vms-lib.c
@@ -2108,6 +2108,7 @@ _bfd_vms_lib_build_map (unsigned int nbr_modules,
 
   *res_cnt = map_count;
   *res = map;
+  free (syms);
   return true;
 
  error_return:
@@ -2394,6 +2395,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch)
       goto err;
   }
 
+  free (symbols);
   return true;
 
  input_err:

                 reply	other threads:[~2023-06-15  2:42 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=20230615024250.06CC23858298@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).