From: Todd C. Miller Date: Thu, 3 May 2018 16:52:17 +0000 (-0600) Subject: Garbage collect the command argv, envp and info vectors since they are X-Git-Tag: SUDO_1_8_24^2~95 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=29d188f4b456f8516114291bbbb56c48db4db086;p=sudo Garbage collect the command argv, envp and info vectors since they are not available at policy close time. --- diff --git a/plugins/sudoers/policy.c b/plugins/sudoers/policy.c index 2c26efb80..dbc70b09a 100644 --- a/plugins/sudoers/policy.c +++ b/plugins/sudoers/policy.c @@ -724,7 +724,12 @@ sudoers_policy_exec_setup(char *argv[], char *envp[], mode_t cmnd_umask, } #endif /* HAVE_SELINUX */ - /* Fill in exec environment info */ + /* 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); + + /* Fill in exec environment info. */ *(exec_args->argv) = argv; *(exec_args->envp) = envp; *(exec_args->info) = command_info;