diff options
author | Mark Young <marky@lunarg.com> | 2022-06-16 19:46:43 +0300 |
---|---|---|
committer | Mark Young <marky@lunarg.com> | 2022-06-16 19:46:43 +0300 |
commit | 9d5854e0bb9a967270b554fc4d0fc163fdfdae17 (patch) | |
tree | 9f2a1d92fb18aa7dd7677a85fc8412e598ccf5ab | |
parent | e1d434018e0c446c0acb8d09d7770eb6532068fc (diff) |
Fix compilation issueFrostByteGER-file_vers_memleak-fix
Variable definition needed to be earlier. I missed this in the
code review as well. Moving it to satisfy compilation warnings.
-rw-r--r-- | loader/loader.c | 4 |
1 files changed, 3 insertions, 1 deletions
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; } |