From: Kristian Høgsberg Kristensen Date: Mon, 4 Jan 2016 18:42:50 +0000 (-0800) Subject: vk: Don't leak pipeline if initialization fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abc1c9878f552b7b7212a5a04048091847ef1c23;p=mesa.git vk: Don't leak pipeline if initialization fails --- 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);