Correct last commit, check before freeing

This commit is contained in:
Campbell Barton 2015-10-04 15:01:46 +11:00
parent 74a2fa3095
commit a3cf661108
1 changed files with 3 additions and 1 deletions

View File

@ -111,7 +111,9 @@ void BLI_buffer_reinit(BLI_Buffer *buffer, size_t new_count)
{
if (UNLIKELY(new_count > buffer->alloc_count)) {
if ((buffer->flag & BLI_BUFFER_USE_STATIC) == 0) {
MEM_freeN(buffer->data);
if (buffer->data) {
MEM_freeN(buffer->data);
}
}
if (buffer->alloc_count && (new_count < buffer->alloc_count * 2)) {