diff options
| author | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-13 09:45:08 +0000 |
|---|---|---|
| committer | Ben Harris <bjh21@bjh21.me.uk> | 2023-02-13 09:45:08 +0000 |
| commit | 11b631ea870355306c4b1d03458bb3cea8f29188 (patch) | |
| tree | 76956e814b30706db5698c4fe0ce5204c801a36b | |
| parent | 0f20b7226957a2fceff37a67b0d9874c7db3a7fc (diff) | |
| download | puzzles-11b631ea870355306c4b1d03458bb3cea8f29188.zip puzzles-11b631ea870355306c4b1d03458bb3cea8f29188.tar.gz puzzles-11b631ea870355306c4b1d03458bb3cea8f29188.tar.bz2 puzzles-11b631ea870355306c4b1d03458bb3cea8f29188.tar.xz | |
Don't leak grids in Loopy's validate_desc()
| -rw-r--r-- | loopy.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -791,13 +791,18 @@ static const char *validate_desc(const game_params *params, const char *desc) count += *desc - 'a' + 1; continue; } + grid_free(g); return "Unknown character in description"; } - if (count < g->num_faces) + if (count < g->num_faces) { + grid_free(g); return "Description too short for board size"; - if (count > g->num_faces) + } + if (count > g->num_faces) { + grid_free(g); return "Description too long for board size"; + } grid_free(g); |