diff options
-rw-r--r-- | indra/llcommon/llmemory.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/indra/llcommon/llmemory.h b/indra/llcommon/llmemory.h index d4f8c152e9..e7488a03d7 100644 --- a/indra/llcommon/llmemory.h +++ b/indra/llcommon/llmemory.h @@ -81,8 +81,11 @@ inline void* ll_aligned_realloc_16(void* ptr, size_t size, size_t old_size) // r #else //FIXME: memcpy is SLOW void* ret = ll_aligned_malloc_16(size); - memcpy(ret, ptr, old_size); - ll_aligned_free_16(ptr); + if (ptr) + { + memcpy(ret, ptr, old_size); + ll_aligned_free_16(ptr); + } return ret; #endif } |