aboutsummaryrefslogtreecommitdiff
path: root/loader/loader.c
diff options
context:
space:
mode:
authorMark Young <marky@lunarg.com>2017-02-03 16:27:42 -0700
committerMark Young <marky@lunarg.com>2017-02-03 16:27:42 -0700
commit9d8b7445333cf528ccf7b40a419c640cb8229f98 (patch)
treea3eb71085e59e2e6d7c9036a8bb1237d64d63916 /loader/loader.c
parent20265543d9ca5b3d6134e8e20ce1568659211298 (diff)
downloadusermoji-9d8b7445333cf528ccf7b40a419c640cb8229f98.tar.xz
loader: gh1449 - Fix mem leak on CTS
Fix a memory leak in the CTS test which fails randomly during the vkCreateInstance call. Change-Id: Ie72feac730d3854cb2af9e13a3687aa43081bfd5
Diffstat (limited to 'loader/loader.c')
-rw-r--r--loader/loader.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 81c37c4c..b6adbb10 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -5046,15 +5046,17 @@ VkResult setupLoaderTermPhysDevs(struct loader_instance *inst) {
out:
if (VK_SUCCESS != res) {
- if (NULL != inst->phys_devs_term) {
- // We've encountered an error, so we should free the
- // new buffers.
+ if (NULL != new_phys_devs) {
+ // We've encountered an error, so we should free the new buffers.
for (uint32_t i = 0; i < inst->total_gpu_count; i++) {
loader_instance_heap_free(inst, new_phys_devs[i]);
}
+ loader_instance_heap_free(inst, new_phys_devs);
+ }
+ if (NULL != inst->phys_devs_term) {
loader_instance_heap_free(inst, inst->phys_devs_term);
- inst->total_gpu_count = 0;
}
+ inst->total_gpu_count = 0;
} else {
// Free everything that didn't carry over to the new array of
// physical devices. Everything else will have been copied over