util/vk_alloc: Ensure NULL is handled correctly in vk_free
Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
@@ -46,6 +46,9 @@ vk_realloc(const VkAllocationCallbacks *alloc,
|
|||||||
static inline void
|
static inline void
|
||||||
vk_free(const VkAllocationCallbacks *alloc, void *data)
|
vk_free(const VkAllocationCallbacks *alloc, void *data)
|
||||||
{
|
{
|
||||||
|
if (data == NULL)
|
||||||
|
return;
|
||||||
|
|
||||||
alloc->pfnFree(alloc->pUserData, data);
|
alloc->pfnFree(alloc->pUserData, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user