mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 09:08:10 +02:00
vulkan: Fix memory leaks.
Fix warnings reported by Coverity Scan. Resource leak (RESOURCE_LEAK) leaked_storage: Variable info going out of scope leaks the storage it points to. Fixes:9bc5b2d169("vulkan: add initial device selection layer. (v6.1)") Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6509> (cherry picked from commit004119d5b7)
This commit is contained in:
parent
22b4120de4
commit
7a63155052
2 changed files with 5 additions and 2 deletions
|
|
@ -526,7 +526,7 @@
|
|||
"description": "vulkan: Fix memory leaks.",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "9bc5b2d169d3a3c9d52fc30987eaba52e3b7dc00"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -137,14 +137,17 @@ static VkResult device_select_CreateInstance(const VkInstanceCreateInfo *pCreate
|
|||
PFN_vkCreateInstance fpCreateInstance =
|
||||
(PFN_vkCreateInstance)info->GetInstanceProcAddr(NULL, "vkCreateInstance");
|
||||
if (fpCreateInstance == NULL) {
|
||||
free(info);
|
||||
return VK_ERROR_INITIALIZATION_FAILED;
|
||||
}
|
||||
|
||||
chain_info->u.pLayerInfo = chain_info->u.pLayerInfo->pNext;
|
||||
|
||||
VkResult result = fpCreateInstance(pCreateInfo, pAllocator, pInstance);
|
||||
if (result != VK_SUCCESS)
|
||||
if (result != VK_SUCCESS) {
|
||||
free(info);
|
||||
return result;
|
||||
}
|
||||
|
||||
for (unsigned i = 0; i < pCreateInfo->enabledExtensionCount; i++) {
|
||||
if (!strcmp(pCreateInfo->ppEnabledExtensionNames[i], VK_KHR_GET_PHYSICAL_DEVICE_PROPERTIES_2_EXTENSION_NAME))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue