Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/KhronosGroup/Vulkan-Loader.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKevin Kuegler <kevinkuegler@outlook.com>2022-06-15 19:33:48 +0300
committerGitHub <noreply@github.com>2022-06-15 19:33:48 +0300
commita9488188da933e32d445aa8daf3458c44dc9fc2b (patch)
tree1be1b0f9b3bbeeb0a545561f70a202eaec88152a
parent71e43122c90f19aca9c387cb43903a0d2e002b08 (diff)
Delete file_vers after branch, fixing possible memory leak
file_vers may be accessed in the following branch even though its memory has been freed
-rw-r--r--loader/loader.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/loader/loader.c b/loader/loader.c
index 07f760ed5..a95dde6bd 100644
--- a/loader/loader.c
+++ b/loader/loader.c
@@ -2574,7 +2574,6 @@ static VkResult loader_add_layer_properties(const struct loader_instance *inst,
"loader_add_layer_properties: %s has unknown layer manifest file version %d.%d.%d. May cause errors.", filename,
json_version.major, json_version.minor, json_version.patch);
}
- loader_instance_heap_free(inst, file_vers);
// If "layers" is present, read in the array of layer objects
layers_node = cJSON_GetObjectItem(json, "layers");
@@ -2631,6 +2630,8 @@ static VkResult loader_add_layer_properties(const struct loader_instance *inst,
} while (layer_node != NULL);
}
}
+
+ loader_instance_heap_free(inst, file_vers);
out: