[Mesa-dev] [PATCH 1/4] util/vk_alloc: Ensure NULL is handled correctly in vk_free
Jason Ekstrand
jason at jlekstrand.net
Fri Nov 11 06:33:53 UTC 2016
---
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 a8e21ca..7ae5c9d 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.5.0.400.gff86faf
More information about the mesa-dev
mailing list