]> granicus.if.org Git - sudo/commitdiff
moved fclose() in skey stuff.
authorTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 4 Oct 1996 03:27:29 +0000 (03:27 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Fri, 4 Oct 1996 03:27:29 +0000 (03:27 +0000)
check.c

diff --git a/check.c b/check.c
index 260b67096dc04c7747e8c995707e4f7ca5866918..12f88f7bdf2786d7ab2a75f24cabfa19b50738e1 100644 (file)
--- a/check.c
+++ b/check.c
@@ -665,6 +665,10 @@ static char *sudo_skeyprompt(user_skey, p)
     static char *orig_prompt, *new_prompt = NULL;
     static int op_len, np_size;
 
+    /* close old stream */
+    if (user_skey->keyfile)
+       (void) fclose(user_skey->keyfile);
+
     /* get the skey part of the prompt */
     if ((rval = skeychallenge(user_skey, user_name, challenge)) != 0) {
 #ifdef SKEY_ONLY
@@ -677,7 +681,6 @@ static char *sudo_skeyprompt(user_skey, p)
        return(orig_prompt);
 #endif /* SKEY_ONLY */
     }
-    (void) fclose(user_skey->keyfile);
 
     /* get space for new prompt with embedded s/key challenge */
     if (new_prompt == NULL) {