public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] vms write_archive memory leaks
@ 2023-06-15  2:42 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-06-15  2:42 UTC (permalink / raw)
  To: bfd-cvs

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:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-15  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-15  2:42 [binutils-gdb] vms write_archive memory leaks Alan Modra

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).