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

Avoid calling sudoers_policy_exec_setup() on error.

We only want to pass the execution environment back for commands
that are accepted or rejected.
Also avoid potentially freeing the wrong pointer when garbage
collection is enabled.
This commit is contained in:
Todd C. Miller
2020-02-24 19:59:44 -07:00
parent f40b4c2887
commit f6a264e719
2 changed files with 13 additions and 7 deletions

View File

@@ -816,7 +816,6 @@ sudoers_policy_exec_setup(char *argv[], char *envp[], mode_t cmnd_umask,
#endif /* HAVE_SELINUX */
/* Free on exit; they are not available in the close function. */
sudoers_gc_add(GC_VECTOR, argv);
sudoers_gc_add(GC_VECTOR, envp);
sudoers_gc_add(GC_VECTOR, command_info);