This is the mail archive of the
mailing list for the GCC project.
[patch] regmove.c: Fix memory leak.
- From: Kazu Hirata <kazu at cs dot umass dot edu>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 10 Dec 2004 15:19:45 -0500 (EST)
- Subject: [patch] regmove.c: Fix memory leak.
Attached is a patch to fix memory leak.
In combine_stack_adjustments_for_block, we set memlist to NULL if we
free it during the course of the function. So, if memlist isn't NULL
at the end of the function, that means we haven't freed it yet.
The patch frees memlist if it hasn't been freed.
Tested on i686-pc-linux-gnu. OK to apply?
2004-12-10 Kazu Hirata <firstname.lastname@example.org>
* regmove.c (combine_stack_adjustments_for_block): Free
memlist if it hasn't been freed.
RCS file: /cvs/gcc/gcc/gcc/regmove.c,v
retrieving revision 1.165
diff -u -d -p -r1.165 regmove.c
--- regmove.c 16 Nov 2004 21:11:33 -0000 1.165
+++ regmove.c 10 Dec 2004 07:47:53 -0000
@@ -2457,4 +2457,7 @@ combine_stack_adjustments_for_block (bas
if (last_sp_set && last_sp_adjust == 0)
+ if (memlist)
+ free_csa_memlist (memlist);