From 9d5854e0bb9a967270b554fc4d0fc163fdfdae17 Mon Sep 17 00:00:00 2001 From: Mark Young Date: Thu, 16 Jun 2022 10:46:43 -0600 Subject: Fix compilation issue Variable definition needed to be earlier. I missed this in the code review as well. Moving it to satisfy compilation warnings. --- loader/loader.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/loader/loader.c b/loader/loader.c index cfc4e0bb4..ffe64a03a 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -2552,6 +2552,7 @@ static VkResult loader_add_layer_properties(const struct loader_instance *inst, // required VkResult result = VK_ERROR_INITIALIZATION_FAILED; cJSON *item, *layers_node, *layer_node; + char *file_vers = NULL; loader_api_version json_version = {0, 0, 0}; // Make sure sure the top level json value is an object if (!json || json->type != 6) { @@ -2561,7 +2562,7 @@ static VkResult loader_add_layer_properties(const struct loader_instance *inst, if (item == NULL) { goto out; } - char *file_vers = cJSON_PrintUnformatted(item); + file_vers = cJSON_PrintUnformatted(item); if (NULL == file_vers) { goto out; } @@ -2637,6 +2638,7 @@ out: if (NULL != file_vers) { loader_instance_heap_free(inst, file_vers); } + return result; } -- cgit v1.2.3