aboutsummaryrefslogtreecommitdiffstats
path: root/src/vulkan/gen8_pipeline.c
diff options
context:
space:
mode:
authorKristian Høgsberg Kristensen <[email protected]>2016-01-04 10:42:50 -0800
committerKristian Høgsberg Kristensen <[email protected]>2016-01-04 10:42:50 -0800
commitabc1c9878f552b7b7212a5a04048091847ef1c23 (patch)
tree8c1f9e6767e72b475f1486891baadc1e6f6983f5 /src/vulkan/gen8_pipeline.c
parentfca1c08e34368dbfa7a10eb1a1508cdd9cda6bf8 (diff)
vk: Don't leak pipeline if initialization fails
Diffstat (limited to 'src/vulkan/gen8_pipeline.c')
-rw-r--r--src/vulkan/gen8_pipeline.c4
1 files changed, 3 insertions, 1 deletions
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);