From: Todd C. Miller Date: Thu, 5 Aug 2010 14:17:21 +0000 (-0400) Subject: delref sudo_user.pw, runas_pw and runas_gr immediately before we exec. X-Git-Tag: SUDO_1_7_5~202 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=deeb53ef401e0c4378697980f82fc3cc35b570b3;p=sudo delref sudo_user.pw, runas_pw and runas_gr immediately before we exec. --HG-- branch : 1.7 --- 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); }