]> git.ipfire.org Git - thirdparty/gcc.git/commit
[libbacktrace] Fix memory leak in build_address_map
authorvries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Dec 2018 03:43:15 +0000 (03:43 +0000)
committervries <vries@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 28 Dec 2018 03:43:15 +0000 (03:43 +0000)
commitf36d7c04756d08e505bd1625af2c043bfa2ef5f1
treebb5714dffebc534c285ee313fee9c02d9645cbce
parent7e239a5b7b92a3d7effd98d085f9ae2998a78aa0
[libbacktrace] Fix memory leak in build_address_map

While upon failure in build_address_map we call free_unit_addrs_vector, this
does not actually free the addrs vector, but merely the abbrevs of the units
pointed at by the elements of the addrs vector.

Fix this by adding code to build_address_map to make sure that the addrs vector
is freed upon failure.

Bootstrapped and reg-tested on x86_64.

2018-12-28  Tom de Vries  <tdevries@suse.de>

* dwarf.c (build_address_map): Free addrs vector upon failure.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@267442 138bc75d-0d04-0410-961f-82ee72b054a4
libbacktrace/ChangeLog
libbacktrace/dwarf.c