wumpus: Fix use after free leading to possible memory corruption when the wumpus eats a player
CID: 1170468
This commit is contained in:
parent
f9999a12bd
commit
ae9d0666af
4
wumpus.c
4
wumpus.c
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue