aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--flood.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/flood.c b/flood.c
index 08410ba..c015c7e 100644
--- a/flood.c
+++ b/flood.c
@@ -942,7 +942,11 @@ static game_state *execute_move(const game_state *state, const char *move)
sol->moves[i] = atoi(p);
p += strspn(p, "0123456789");
if (*p) {
- assert(*p == ',');
+ if (*p != ',') {
+ sfree(sol->moves);
+ sfree(sol);
+ return NULL;
+ }
p++;
}
}