[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug binutils/29925] Memory leak in find_abstract_instance
From: |
cvs-commit at gcc dot gnu.org |
Subject: |
[Bug binutils/29925] Memory leak in find_abstract_instance |
Date: |
Wed, 21 Dec 2022 21:28:40 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=29925
--- Comment #1 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot
gnu.org> ---
The master branch has been updated by Alan Modra <amodra@sourceware.org>:
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d28fbc7197ba0e021a43f873eff90b05dcdcff6a
commit d28fbc7197ba0e021a43f873eff90b05dcdcff6a
Author: Alan Modra <amodra@gmail.com>
Date: Wed Dec 21 21:40:12 2022 +1030
PR29925, Memory leak in find_abstract_instance
The testcase in the PR had a variable with both DW_AT_decl_file and
DW_AT_specification, where the DW_AT_specification also specified
DW_AT_decl_file. This leads to a memory leak as the file name is
malloced and duplicates are not expected.
I've also changed find_abstract_instance to not use a temp for "name",
because that can result in a change in behaviour from the usual last
of duplicate attributes wins.
PR 29925
* dwarf2.c (find_abstract_instance): Delete "name" variable.
Free *filename_ptr before assigning new file name.
(scan_unit_for_symbols): Similarly free func->file and
var->file before assigning.
--
You are receiving this mail because:
You are on the CC list for the bug.