From abc1c9878f552b7b7212a5a04048091847ef1c23 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Kristian=20H=C3=B8gsberg=20Kristensen?= Date: Mon, 4 Jan 2016 10:42:50 -0800 Subject: [PATCH] vk: Don't leak pipeline if initialization fails --- src/vulkan/gen8_pipeline.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/vulkan/gen8_pipeline.c b/src/vulkan/gen8_pipeline.c index ae8ab404746..827a013ebdc 100644 --- a/src/vulkan/gen8_pipeline.c +++ b/src/vulkan/gen8_pipeline.c @@ -290,8 +290,10 @@ genX(graphics_pipeline_create)( return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY); result = anv_pipeline_init(pipeline, device, pCreateInfo, extra, pAllocator); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS) { + anv_free2(&device->alloc, pAllocator, pipeline); return result; + } assert(pCreateInfo->pVertexInputState); emit_vertex_input(pipeline, pCreateInfo->pVertexInputState, extra); -- 2.30.2