Skip to content

Commit

Permalink
vulkan-loader: Fix leak in settings fuzzer (google#12870)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
charles-lunarg and DavidKorczynski authored Dec 19, 2024
1 parent e8f3e6c commit e17999e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions projects/vulkan-loader/fuzzers/settings_fuzzer.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit e17999e

Please sign in to comment.