This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Fix memory leak introduced in r238336
- From: Martin Liška <mliska at suse dot cz>
- To: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Cc: Jan Hubicka <hubicka at ucw dot cz>
- Date: Mon, 25 Jul 2016 10:58:25 +0200
- Subject: [PATCH] Fix memory leak introduced in r238336
- Authentication-results: sourceware.org; auth=none
Hi.
This is quite obvious change.
I've been waiting for bootstrap and regression tests on ppc64le-redhat-linux.
Ready after it finishes?
Martin
>From 2f416d7feca35d9075124f4dc74f3560a18beefb Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 22 Jul 2016 12:46:08 +0200
Subject: [PATCH] Fix memory leak introduced in r238336
gcc/ChangeLog:
2016-07-22 Martin Liska <mliska@suse.cz>
* tree-ssa-loop-niter.c (loop_only_exit_p): Release body array.
---
gcc/tree-ssa-loop-niter.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c
index b7d7c32..95bb5cf 100644
--- a/gcc/tree-ssa-loop-niter.c
+++ b/gcc/tree-ssa-loop-niter.c
@@ -2119,7 +2119,10 @@ loop_only_exit_p (const struct loop *loop, const_edge exit)
{
for (bsi = gsi_start_bb (body[i]); !gsi_end_p (bsi); gsi_next (&bsi))
if (stmt_can_terminate_bb_p (gsi_stmt (bsi)))
- return true;
+ {
+ free (body);
+ return true;
+ }
}
free (body);
--
2.9.0