Add a null check to ma_free().

This commit is contained in:
David Reid
2021-07-18 09:45:14 +10:00
parent fa2fc03e1f
commit cfb7020ae8
+4
View File
@@ -44818,6 +44818,10 @@ MA_API void* ma_realloc(void* p, size_t sz, const ma_allocation_callbacks* pAllo
MA_API void ma_free(void* p, const ma_allocation_callbacks* pAllocationCallbacks)
{
if (p == NULL) {
return;
}
if (pAllocationCallbacks != NULL) {
if (pAllocationCallbacks->onFree != NULL) {
pAllocationCallbacks->onFree(p, pAllocationCallbacks->pUserData);