]> granicus.if.org Git - sudo/commitdiff
Remove extraneous call to init_defaults() and set runas_user to NULL
authorTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 5 Jun 2000 02:57:10 +0000 (02:57 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Mon, 5 Jun 2000 02:57:10 +0000 (02:57 +0000)
betweem parses so init_defaults will reset it each time, thus avoiding
a reference to free()d data.

visudo.c

index 2b2bc2f06bb0c0e7c36d1091677e5ca5982342a4..4121e0646cd3949952f14f4faeab32012aee46ca 100644 (file)
--- a/visudo.c
+++ b/visudo.c
@@ -219,7 +219,6 @@ main(argc, argv)
        /* Parse sudoers to pull in editor and env_editor conf values. */
        if ((yyin = fopen(stmp, "r"))) {
            yyout = stdout;
-           init_defaults();
            init_parser();
            yyparse();
            parse_error = FALSE;
@@ -380,6 +379,7 @@ main(argc, argv)
            }
 
            /* Clean slate for each parse */
+           user_runas = NULL;
            init_defaults();
            init_parser();