Skip to content

Commit

Permalink
Free ICD "library_path" when it contains an empty string
Browse files Browse the repository at this point in the history
If "library_path" contained nothing, loader_parse_json_string returns the string "", which still needs to be freed.
  • Loading branch information
charles-lunarg committed Nov 25, 2024
1 parent 39eb3cf commit 5c0073c
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions loader/loader.c
Original file line number Diff line number Diff line change
Expand Up @@ -3612,12 +3612,11 @@ VkResult loader_parse_icd_manifest(const struct loader_instance *inst, char *fil
"loader_parse_icd_manifest: Failed retrieving ICD JSON %s \'library_path\' field. Skipping ICD JSON.", file_str);
res = VK_ERROR_OUT_OF_HOST_MEMORY;
goto out;
}

if (!library_path || strlen(library_path) == 0) {
} else if (!library_path || strlen(library_path) == 0) {
loader_log(inst, VULKAN_LOADER_WARN_BIT | VULKAN_LOADER_DRIVER_BIT, 0,
"loader_parse_icd_manifest: ICD JSON %s \'library_path\' field is empty. Skipping ICD JSON.", file_str);
res = VK_ERROR_INCOMPATIBLE_DRIVER;
loader_instance_heap_free(inst, library_path);
goto out;
}

Expand Down

0 comments on commit 5c0073c

Please sign in to comment.