vk: Don't leak pipeline if initialization fails

This commit is contained in:
Kristian Høgsberg Kristensen 2016-01-04 10:42:50 -08:00
parent fca1c08e34
commit abc1c9878f
1 changed files with 3 additions and 1 deletions

View File

@ -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);