From e17999e560033052914a77fc0a02540d66cd91e0 Mon Sep 17 00:00:00 2001 From: Charles Giessen <46324611+charles-lunarg@users.noreply.github.com> Date: Thu, 19 Dec 2024 04:01:07 -0600 Subject: [PATCH] vulkan-loader: Fix leak in settings fuzzer (#12870) The fuzzer would leak the settings layer list if it successfully found the layers. This creates memory leaks that aren't directly the fault of the Vulkan-Loader project. Co-authored-by: DavidKorczynski --- projects/vulkan-loader/fuzzers/settings_fuzzer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/projects/vulkan-loader/fuzzers/settings_fuzzer.c b/projects/vulkan-loader/fuzzers/settings_fuzzer.c index 4a40d614475d..9d2430f81f79 100644 --- a/projects/vulkan-loader/fuzzers/settings_fuzzer.c +++ b/projects/vulkan-loader/fuzzers/settings_fuzzer.c @@ -71,6 +71,8 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { bool should_search_for_other_layers = true; get_settings_layers(NULL, &settings_layers, &should_search_for_other_layers); + // Free allocated memory + loader_delete_layer_list_and_properties(NULL, (struct loader_layer_list *)settings_layers.list); should_skip_logging_global_messages(0); update_global_loader_settings(); teardown_global_loader_settings();