aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-structalias.c
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-12-28 03:43:26 +0000
committerTom de Vries <vries@gcc.gnu.org>2018-12-28 03:43:26 +0000
commit40b8d3b2536246b7449b6c7ce7a972537e5f11e1 (patch)
treecc1452c21352d3d57cf000f1eb44f626d7a9f40e /gcc/tree-ssa-structalias.c
parent53a52133a5fc74d63ce17b328774706bf1e79e02 (diff)
downloadgcc-40b8d3b2536246b7449b6c7ce7a972537e5f11e1.zip
gcc-40b8d3b2536246b7449b6c7ce7a972537e5f11e1.tar.gz
gcc-40b8d3b2536246b7449b6c7ce7a972537e5f11e1.tar.bz2
[libbacktrace] Fix memory leak in loop in build_address_map
When failing in build_address_map, we free the unit that's currently being handled in the loop, but the ones that already have been allocated are leaked. Fix this by keeping track of allocated units in a vector, and releasing them upon failure. Also, now that we have a vector of allocated units, move the freeing upon failure of the abbrevs associated with each unit to build_address_map, and remove the now redundant call to free_unit_addrs_vector. Bootstrapped and reg-tested on x86_64. 2018-12-28 Ian Lance Taylor <iant@golang.org> Tom de Vries <tdevries@suse.de> PR libbacktrace/88063 * dwarf.c (free_unit_addrs_vector): Remove. (build_address_map): Keep track of allocated units in vector. Free allocated units and corresponding abbrevs upon failure. Remove now redundant call to free_unit_addrs_vector. Free addrs vector upon failure. Free allocated unit vector. Co-Authored-By: Tom de Vries <tdevries@suse.de> From-SVN: r267443
Diffstat (limited to 'gcc/tree-ssa-structalias.c')
0 files changed, 0 insertions, 0 deletions