grid_free(): allow being called with grid == NULL

This commit is contained in:
Daniel Eklöf 2022-10-18 18:30:02 +02:00
parent 09d52d5db6
commit c4f08a3b9a
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

3
grid.c
View file

@ -287,6 +287,9 @@ grid_snapshot(const struct grid *grid)
void
grid_free(struct grid *grid)
{
if (grid == NULL)
return;
for (int r = 0; r < grid->num_rows; r++)
grid_row_free(grid->rows[r]);