if the keytab isn't resolved, then don't try to use it
authorJohn Kohl <jtkohl@mit.edu>
Fri, 11 May 1990 16:08:31 +0000 (16:08 +0000)
committerJohn Kohl <jtkohl@mit.edu>
Fri, 11 May 1990 16:08:31 +0000 (16:08 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@847 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/rd_req_dec.c

index 695e7bf819fdc013bb09fb8bd7abd21c4e101f20..363bae80016f5bfba79740030b8d4115dda87a48 100644 (file)
@@ -100,14 +100,16 @@ krb5_tkt_authent *tktauthent;
            /* use default keytab */
            retval = krb5_kt_default(&keytabid);
        }
-       retval = krb5_kt_get_entry(keytabid, req->ticket->server,
-                                  req->ticket->skvno, &ktentry);
-       (void) krb5_kt_close(keytabid);
        if (!retval) {
-           retval = krb5_copy_keyblock(&ktentry.key, &tkt_key_real);
-           tkt_key = &tkt_key_real;
+           retval = krb5_kt_get_entry(keytabid, req->ticket->server,
+                                      req->ticket->skvno, &ktentry);
+           (void) krb5_kt_close(keytabid);
+           if (!retval) {
+               retval = krb5_copy_keyblock(&ktentry.key, &tkt_key_real);
+               tkt_key = &tkt_key_real;
+           }
+           (void) krb5_kt_free_entry(&ktentry);
        }
-       (void) krb5_kt_free_entry(&ktentry);
     }
     if (retval)
        return retval;                  /* some error in getting the key */