[gnome-nibbles] Fix leak in gnibbles_move_worms()



commit aca95c140bf0b25fb4ccc0bd3f1e0791e659ff08
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sat Jul 19 16:30:34 2014 -0500

    Fix leak in gnibbles_move_worms()
    
    Always free dead before returning
    
    https://bugzilla.gnome.org/show_bug.cgi?id=733424

 src/gnibbles.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/src/gnibbles.c b/src/gnibbles.c
index af3c2d2..abcb9fa 100644
--- a/src/gnibbles.c
+++ b/src/gnibbles.c
@@ -269,6 +269,8 @@ gnibbles_move_worms (void)
     }
   }
 
+  g_free (dead);
+
   for (i = 0; i < properties->numworms; i++) {
     if (worms[i]->human && worms[i]->lives <= 0)
       return GAMEOVER;
@@ -289,7 +291,6 @@ gnibbles_move_worms (void)
   }
    /* Noone died, so the round can continue. */
 
-  g_free (dead);
   return CONTINUE;
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]