Fix leak in splay-tree
authorTom Tromey <tom@tromey.com>
Mon, 21 Jan 2019 15:41:28 +0000 (08:41 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 21 Jan 2019 16:05:01 +0000 (09:05 -0700)
commitd7167c671da0323daf31a8e07945c57c25f858d2
treef51aa2a375d4c9bbeb38df4941b41a0579793682
parent73021deb50855f31bb312241899a464c62155f6a
Fix leak in splay-tree

Philippe Waroquiers noticed a memory leak in gdb, which he tracked
down to a bug in splay-tree.  splay_tree_remove does not call the
`delete_key' function when it removes the old node; but it should.

I looked at every splay tree in GCC and there is only one that passes
a non-NULL delete function -- the one in lto.c.  That file does not
call splay_tree_remove.  So, I think this is safe to check in.

I re-ran the LTO tests to double check.

libiberty/
* splay-tree.c (splay_tree_remove): Delete the key if necessary.
libiberty/ChangeLog
libiberty/splay-tree.c
This page took 0.02559 seconds and 4 git commands to generate.