diff -ura sudo-1.6.8p8/parse.yacc sudo-1.6.8p9/parse.yacc --- sudo-1.6.8p8/parse.yacc Wed Aug 11 12:29:10 2004 +++ sudo-1.6.8p9/parse.yacc Sun Jun 19 12:24:32 2005 @@ -676,10 +676,6 @@ } $$ = TRUE; - - if (safe_cmnd) - free(safe_cmnd); - safe_cmnd = estrdup(user_cmnd); } | ALIAS { aliasinfo *aip; diff -ura sudo-1.6.8p8/sudo.c sudo-1.6.8p9/sudo.c --- sudo-1.6.8p8/sudo.c Thu Mar 24 18:56:41 2005 +++ sudo-1.6.8p9/sudo.c Sun Jun 19 14:35:46 2005 @@ -275,6 +275,8 @@ /* Validate the user but don't search for pseudo-commands. */ validated = sudoers_lookup(pwflag); } + if (safe_cmnd == NULL) + safe_cmnd = user_cmnd; /* * If we are using set_perms_posix() and the stay_setuid flag was not set, @@ -389,14 +391,6 @@ sudo_ldap_list_matches(); #endif exit(0); - } - - /* This *must* have been set if we got a match but... */ - if (safe_cmnd == NULL) { - log_error(MSG_ONLY, - "internal error, safe_cmnd never got set for %s; %s", - user_cmnd, - "please report this error at http://courtesan.com/sudo/bugs/"); } /* Override user's umask if configured to do so. */