From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1062) id 06CC23858298; Thu, 15 Jun 2023 02:42:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06CC23858298 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Alan Modra To: bfd-cvs@sourceware.org Subject: [binutils-gdb] vms write_archive memory leaks X-Act-Checkin: binutils-gdb X-Git-Author: Alan Modra X-Git-Refname: refs/heads/master X-Git-Oldrev: 87642f631119652ed57ccbdf7cfbfcf518b315a1 X-Git-Newrev: 6a28a3c20044db82f86aad208497e2c8f6557f93 Message-Id: <20230615024250.06CC23858298@sourceware.org> Date: Thu, 15 Jun 2023 02:42:50 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 15 Jun 2023 02:42:50 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6a28a3c20044= db82f86aad208497e2c8f6557f93 commit 6a28a3c20044db82f86aad208497e2c8f6557f93 Author: Alan Modra Date: Thu Jun 15 10:02:31 2023 +0930 vms write_archive memory leaks =20 This fixes two memory leaks in the vms archive handling. =20 * 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, =20 *res_cnt =3D map_count; *res =3D map; + free (syms); return true; =20 error_return: @@ -2394,6 +2395,7 @@ _bfd_vms_lib_write_archive_contents (bfd *arch) goto err; } =20 + free (symbols); return true; =20 input_err: