mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-05 04:06:08 -05:00
grid_free(): allow being called with grid == NULL
This commit is contained in:
parent
09d52d5db6
commit
c4f08a3b9a
1 changed files with 3 additions and 0 deletions
3
grid.c
3
grid.c
|
|
@ -287,6 +287,9 @@ grid_snapshot(const struct grid *grid)
|
||||||
void
|
void
|
||||||
grid_free(struct grid *grid)
|
grid_free(struct grid *grid)
|
||||||
{
|
{
|
||||||
|
if (grid == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
for (int r = 0; r < grid->num_rows; r++)
|
for (int r = 0; r < grid->num_rows; r++)
|
||||||
grid_row_free(grid->rows[r]);
|
grid_row_free(grid->rows[r]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue