diff options
| author | Jon Ashburn <jon@lunarg.com> | 2015-06-16 14:43:19 -0600 |
|---|---|---|
| committer | Courtney Goeltzenleuchter <courtney@LunarG.com> | 2015-06-18 10:22:57 -0600 |
| commit | e35b0a6c77018bd5b6df570e48bb6ae97cb6c003 (patch) | |
| tree | 30ba3744e2cbcf6f8c7b245dfbc0ff0b739f9cd5 /loader/loader.c | |
| parent | da3549ed1fb20e3455b450df6f3cd9cff1b037fd (diff) | |
| download | usermoji-e35b0a6c77018bd5b6df570e48bb6ae97cb6c003.tar.xz | |
loader: Fix memory free bug in destroying icd from DestroyInstance
Diffstat (limited to 'loader/loader.c')
| -rw-r--r-- | loader/loader.c | 7 |
1 files changed, 5 insertions, 2 deletions
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; } |
