[gnome-nibbles] Fix leak in gnibbles_move_worms()
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-nibbles] Fix leak in gnibbles_move_worms()
- Date: Tue, 19 Aug 2014 00:40:35 +0000 (UTC)
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]