From: Todd C. Miller Date: Wed, 27 Jun 2012 21:04:39 +0000 (-0400) Subject: Zero pointers in sudo_user struct after freeing, just in case. X-Git-Tag: SUDO_1_8_6^2~113 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7d5048a5be200dcd37919e57df01dff091074d78;p=sudo Zero pointers in sudo_user struct after freeing, just in case. --- diff --git a/plugins/sudoers/sudoers.c b/plugins/sudoers/sudoers.c index 3d697837c..c639e2080 100644 --- a/plugins/sudoers/sudoers.c +++ b/plugins/sudoers/sudoers.c @@ -269,12 +269,19 @@ sudoers_policy_close(int exit_status, int error_code) /* Free remaining references to password and group entries. */ sudo_pw_delref(sudo_user.pw); + sudo_user.pw = NULL; sudo_pw_delref(runas_pw); - if (runas_gr != NULL) + runas_pw = NULL; + if (runas_gr != NULL) { sudo_gr_delref(runas_gr); - if (user_group_list != NULL) + runas_gr = NULL; + } + if (user_group_list != NULL) { sudo_grlist_delref(user_group_list); + user_group_list = NULL; + } efree(user_gids); + user_gids = NULL; debug_return; }