wumpus: Fix use after free leading to possible memory corruption when the wumpus eats a player

CID: 1170468
This commit is contained in:
Attila Molnar 2014-09-18 01:55:17 +02:00
parent f9999a12bd
commit ae9d0666af
1 changed files with 5 additions and 3 deletions

View File

@ -630,10 +630,12 @@ move_wumpus(void *unused)
/* player_t *p has been eaten and is no longer in the game */ /* player_t *p has been eaten and is no longer in the game */
resign_player(p); resign_player(p);
} }
else
{
/* prepare for the next turn */ /* prepare for the next turn */
p->has_moved = false; p->has_moved = false;
} }
}
/* report any wumpus kills */ /* report any wumpus kills */
if (w_kills) if (w_kills)