2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-30 22:05:46 +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

@@ -1872,6 +1872,9 @@ sudoers_cleanup(void)
sudo_freegrcache();
canon_path_free_cache();
/* We must free the cached environment before running g/c. */
env_init(NULL);
/* Run garbage collector. */
sudoers_gc_run();