]> git.ipfire.org Git - thirdparty/gcc.git/commit - libiberty/ChangeLog
Fix leak in splay-tree
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Jan 2019 15:25:29 +0000 (15:25 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 21 Jan 2019 15:25:29 +0000 (15:25 +0000)
commit996bdad985c52cfec85a101463fb5c87ade93551
treeeecff65f98f1b03858f03fdc3b8165fba939c075
parent26e8495a7895777d8f4a5631b9c3175bcef0a48d
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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@268116 138bc75d-0d04-0410-961f-82ee72b054a4
libiberty/ChangeLog
libiberty/splay-tree.c