util/vk_alloc: Ensure NULL is handled correctly in vk_free

Reviewed-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Jason Ekstrand 2016-11-10 21:12:16 -08:00
parent 18266247a0
commit d0646c8015
1 changed files with 3 additions and 0 deletions

View File

@ -46,6 +46,9 @@ vk_realloc(const VkAllocationCallbacks *alloc,
static inline void
vk_free(const VkAllocationCallbacks *alloc, void *data)
{
if (data == NULL)
return;
alloc->pfnFree(alloc->pUserData, data);
}