aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorJon Ashburn <jon@lunarg.com>2015-11-02 17:59:02 -0700
committerJon Ashburn <jon@lunarg.com>2015-11-03 14:51:46 -0700
commit6348a912e40b66d71d75cdb598e0b21dc276934d (patch)
tree7bc0a50128131b94efb3671589a985dea4d47e98 /loader/loader.c
parent628e0055baa6c2f237c7fb94495011c9677bc88b (diff)
downloadusermoji-6348a912e40b66d71d75cdb598e0b21dc276934d.tar.xz
loader: Resource cleanup on loaer_init_physical_device_info()
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 4363fd7b..94aff594 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2801,6 +2801,8 @@ VkResult loader_init_physical_device_info(struct loader_instance *ptr_instance)
phys_devs[i].phys_devs = (VkPhysicalDevice *) loader_stack_alloc(
phys_devs[i].count * sizeof(VkPhysicalDevice));
if (!phys_devs[i].phys_devs) {
+ loader_heap_free(ptr_instance, ptr_instance->phys_devs);
+ ptr_instance->phys_devs = NULL;
return VK_ERROR_OUT_OF_HOST_MEMORY;
}
res = icd->EnumeratePhysicalDevices(
@@ -2820,8 +2822,11 @@ VkResult loader_init_physical_device_info(struct loader_instance *ptr_instance)
idx++;
}
- } else
+ } else {
+ loader_heap_free(ptr_instance, ptr_instance->phys_devs);
+ ptr_instance->phys_devs = NULL;
return res;
+ }
icd = icd->next;
}