From d0646c8015015b90bcc933e23bdd927cc0c81bb7 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 10 Nov 2016 21:12:16 -0800 Subject: [PATCH] util/vk_alloc: Ensure NULL is handled correctly in vk_free Reviewed-by: Dave Airlie --- src/util/vk_alloc.h | 3 +++ 1 file changed, 3 insertions(+) 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); } -- 2.30.2