This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix memory leak in DOM
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 12 Oct 2004 10:41:28 -0400
- Subject: [PATCH] Fix memory leak in DOM
A simple memory leak plug.
OK? Bootstrapped and tested on powerpc-darwin.
ChangeLog:
* tree-ssa-dom.c (record_range): Free the element if we are not
going to use it.
Index: tree-ssa-dom.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree-ssa-dom.c,v
retrieving revision 2.58
diff -u -p -r2.58 tree-ssa-dom.c
--- tree-ssa-dom.c 4 Oct 2004 13:19:20 -0000 2.58
+++ tree-ssa-dom.c 12 Oct 2004 14:39:46 -0000
@@ -3013,6 +3013,8 @@ record_range (tree cond, basic_block bb)
if (*slot == NULL)
*slot = (void *) vrp_hash_elt;
+ else
+ free (vrp_hash_elt);
vrp_hash_elt = (struct vrp_hash_elt *) *slot;
vrp_records_p = &vrp_hash_elt->records;