From: Jason Ekstrand Date: Fri, 11 Nov 2016 05:12:16 +0000 (-0800) Subject: util/vk_alloc: Ensure NULL is handled correctly in vk_free X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d0646c8015015b90bcc933e23bdd927cc0c81bb7;p=mesa.git util/vk_alloc: Ensure NULL is handled correctly in vk_free Reviewed-by: Dave Airlie --- diff --git a/src/util/vk_alloc.h b/src/util/vk_alloc.h index a8e21cade11..7ae5c9dfe40 100644 --- a/src/util/vk_alloc.h +++ b/src/util/vk_alloc.h @@ -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); }