=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/sudo/Attic/visudo.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- src/usr.bin/sudo/Attic/visudo.c 2002/01/03 03:49:16 1.11 +++ src/usr.bin/sudo/Attic/visudo.c 2002/01/17 16:48:01 1.12 @@ -73,7 +73,7 @@ #include "version.h" #ifndef lint -static const char rcsid[] = "$Sudo: visudo.c,v 1.145 2001/12/14 19:52:48 millert Exp $"; +static const char rcsid[] = "$Sudo: visudo.c,v 1.146 2002/01/17 15:35:54 millert Exp $"; #endif /* lint */ /* @@ -277,7 +277,7 @@ * See if we can use the user's choice of editors either because * we allow any $EDITOR or because $EDITOR is in the allowable list. */ - Editor = NULL; + Editor = EditorPath = NULL; if (def_flag(I_ENV_EDITOR) && UserEditor) Editor = UserEditor; else if (UserEditor) { @@ -318,7 +318,6 @@ break; } } while ((Editor = strtok(NULL, ":"))); - free(EditorPath); } /* @@ -326,6 +325,8 @@ * find one that exists, is regular, and is executable. */ if (Editor == NULL || *Editor == '\0') { + if (EditorPath != NULL) + free(EditorPath); EditorPath = estrdup(def_str(I_EDITOR)); Editor = strtok(EditorPath, ":"); do {