Fix memory leak introduced in r238336
authorMartin Liska <mliska@suse.cz>
Mon, 25 Jul 2016 10:52:30 +0000 (12:52 +0200)
committerMartin Liska <marxin@gcc.gnu.org>
Mon, 25 Jul 2016 10:52:30 +0000 (10:52 +0000)
* tree-ssa-loop-niter.c (loop_only_exit_p): Release body array.

From-SVN: r238705

gcc/ChangeLog
gcc/tree-ssa-loop-niter.c

index a6755ab614c51d71a8c9b5b527fa0c1b48463928..18a969f46e6f164636340f8d7d4b83d212bb6954 100644 (file)
@@ -1,3 +1,7 @@
+2016-07-25  Martin Liska  <mliska@suse.cz>
+
+       * tree-ssa-loop-niter.c (loop_only_exit_p): Release body array.
+
 2016-07-25  Martin Liska  <mliska@suse.cz>
 
        PR tree-optimization/71987
index b7d7c324efd5ac82a07b1a13d238b3d707565520..95bb5cf112643e9f51d1315b9572d82b0dad16ff 100644 (file)
@@ -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);