From deeb53ef401e0c4378697980f82fc3cc35b570b3 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 5 Aug 2010 10:17:21 -0400 Subject: [PATCH] delref sudo_user.pw, runas_pw and runas_gr immediately before we exec. --HG-- branch : 1.7 --- sudo.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/sudo.c b/sudo.c index 04fd3f288..63c727c6c 100644 --- a/sudo.c +++ b/sudo.c @@ -908,6 +908,10 @@ exec_setup(rbac_enabled, ttyname, ttyfd) /* Close the password and group files and free up memory. */ sudo_endpwent(); sudo_endgrent(); + pw_delref(sudo_user.pw); + pw_delref(runas_pw); + if (runas_gr != NULL) + gr_delref(runas_gr); rval = TRUE; @@ -962,6 +966,12 @@ run_command(path, argv, envp, uid, dowait) #ifdef _PATH_SUDO_IO_LOGDIR io_log_close(); #endif + sudo_endpwent(); + sudo_endgrent(); + pw_delref(sudo_user.pw); + pw_delref(runas_pw); + if (runas_gr != NULL) + gr_delref(runas_gr); return(exitcode); } -- 2.40.0