From: Dave Airlie Date: Tue, 11 Oct 2016 22:52:56 +0000 (+1000) Subject: radv: fix memory leak from physical device if wsi fails X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6215b476482fa3a76d3245d88ab127a7c060e115;p=mesa.git radv: fix memory leak from physical device if wsi fails Inspired by patch from Edward O'Callaghan which didn't do it right. Signed-off-by: Dave Airlie --- diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 8c59344a3c8..79ef8ed55db 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -74,8 +74,10 @@ radv_physical_device_init(struct radv_physical_device *device, } device->ws->query_info(device->ws, &device->rad_info); result = radv_init_wsi(device); - if (result != VK_SUCCESS) + if (result != VK_SUCCESS) { + device->ws->destroy(device->ws); goto fail; + } fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n"); device->name = device->rad_info.name;