From: Martin Liska Date: Mon, 25 Jul 2016 10:52:30 +0000 (+0200) Subject: Fix memory leak introduced in r238336 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ccae0c8546a8b9e6fe00f180ae097a3f83b1e113;p=gcc.git Fix memory leak introduced in r238336 * tree-ssa-loop-niter.c (loop_only_exit_p): Release body array. From-SVN: r238705 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a6755ab614c..18a969f46e6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,7 @@ +2016-07-25 Martin Liska + + * tree-ssa-loop-niter.c (loop_only_exit_p): Release body array. + 2016-07-25 Martin Liska PR tree-optimization/71987 diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index b7d7c324efd..95bb5cf1126 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);