From e35b0a6c77018bd5b6df570e48bb6ae97cb6c003 Mon Sep 17 00:00:00 2001 From: Jon Ashburn Date: Tue, 16 Jun 2015 14:43:19 -0600 Subject: loader: Fix memory free bug in destroying icd from DestroyInstance --- loader/loader.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'loader/loader.c') diff --git a/loader/loader.c b/loader/loader.c index 3ad11985..3f13cdbc 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -1527,6 +1527,7 @@ VkResult loader_DestroyInstance( { struct loader_instance *ptr_instance = loader_instance(instance); struct loader_icd *icds = ptr_instance->icds; + struct loader_icd *next_icd; VkResult res; // Remove this instance from the list of instances: @@ -1557,9 +1558,11 @@ VkResult loader_DestroyInstance( loader_log(VK_DBG_REPORT_WARN_BIT, 0, "ICD ignored: failed to DestroyInstance on device"); } - loader_icd_destroy(ptr_instance, icds); + next_icd = icds->next; icds->instance = VK_NULL_HANDLE; - icds = icds->next; + loader_icd_destroy(ptr_instance, icds); + + icds = next_icd; } -- cgit v1.2.3