Skip to content

Commit dc509c2

Browse files
pdaniell-nvcharles-lunarg
authored andcommitted
Fix memory leak
This shows up with the Vulkan CTS test "dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic" and appears to be a regression from 77ccbe4
1 parent c0c74b8 commit dc509c2

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

loader/loader.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2258,13 +2258,16 @@ VkResult loader_scanned_icd_add(const struct loader_instance *inst, struct loade
22582258
loader_log(inst, VULKAN_LOADER_ERROR_BIT, 0, "loader_scanned_icd_add: Out of memory can't add ICD %s", filename);
22592259
goto out;
22602260
}
2261-
icd_tramp_list->count++;
22622261

22632262
// Uses OS calls to find the 'true' path to the binary, for more accurate logging later on.
22642263
res = fixup_library_binary_path(inst, &(new_scanned_icd->lib_name), new_scanned_icd->handle, fp_get_proc_addr);
22652264
if (res == VK_ERROR_OUT_OF_HOST_MEMORY) {
2265+
loader_instance_heap_free(inst, new_scanned_icd->lib_name);
22662266
goto out;
22672267
}
2268+
2269+
icd_tramp_list->count++;
2270+
22682271
out:
22692272
if (res != VK_SUCCESS) {
22702273
if (NULL != handle) {

0 commit comments

Comments
 (0)