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

For plugin API 1.15 and up, always call the plugin close function.

Previously, it was only called when a command was run (including
sudoedit).  Now, plugin operations list, validate, invalidate, and
show_version are also closed.
This commit is contained in:
Todd C. Miller
2019-11-20 10:57:47 -07:00
parent 2143746370
commit f976a5d866
4 changed files with 103 additions and 22 deletions

View File

@@ -869,10 +869,14 @@ sudoers_policy_close(int exit_status, int error_code)
/* Free remaining references to password and group entries. */
/* XXX - move cleanup to function in sudoers.c */
sudo_pw_delref(sudo_user.pw);
sudo_user.pw = NULL;
sudo_pw_delref(runas_pw);
runas_pw = NULL;
if (sudo_user.pw != NULL) {
sudo_pw_delref(sudo_user.pw);
sudo_user.pw = NULL;
}
if (runas_pw != NULL) {
sudo_pw_delref(runas_pw);
runas_pw = NULL;
}
if (runas_gr != NULL) {
sudo_gr_delref(runas_gr);
runas_gr = NULL;