Fix error freeing NULL if BArrayStore_AtSize is empty

Calling BLI_array_store_at_size_clear on an BArrayStore_AtSize
which was not used would attempt to free a NULL pointer.
This commit is contained in:
Campbell Barton 2023-03-11 11:57:08 +11:00
parent 412c62f62e
commit 2bfe9b50c6
1 changed files with 2 additions and 2 deletions

View File

@ -54,8 +54,8 @@ void BLI_array_store_at_size_clear(struct BArrayStore_AtSize *bs_stride)
}
}
MEM_freeN(bs_stride->stride_table);
bs_stride->stride_table = NULL;
/* It's possible this table was never used. */
MEM_SAFE_FREE(bs_stride->stride_table);
bs_stride->stride_table_len = 0;
}