2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-31 06:15:37 +00:00

sudoers_cleanup: free cached environment before running g/c.

Avoids a double free in fuzz_policy.
This commit is contained in:
Todd C. Miller
2023-03-10 15:23:48 -07:00
parent cd5cd45336
commit c76ac1cab3
2 changed files with 3 additions and 4 deletions

View File

@@ -498,13 +498,9 @@ LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
sudoers_policy.close(0, 0);
else
sudoers_cleanup();
/* Call a second time to free old env pointer. */
env_init(NULL);
}
sudoers_policy.deregister_hooks(SUDO_API_VERSION, fuzz_hook_stub);
sudoers_gc_run();
free_dynamic_array(&plugin_args);
free_dynamic_array(&settings);