From: Jason Ekstrand Date: Wed, 15 Jul 2015 22:15:54 +0000 (-0700) Subject: vk/device: Provide proper NULL handling in anv_device_free X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4748bff59b21c51092a081df48d7d00f2bfbfef;p=mesa.git vk/device: Provide proper NULL handling in anv_device_free The Vulkan spec does not specify that the free function provided to CreateInstance must handle NULL properly so we do it in the wrapper. If this ever changes in the spec, we can delete the extra 2 lines. --- diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 2b8bcbe9e82..454e8f48f42 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -1057,6 +1057,9 @@ void anv_device_free(struct anv_device * device, void * mem) { + if (mem == NULL) + return; + return device->instance->pfnFree(device->instance->pAllocUserData, mem); }