summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorTom Yu <tlyu@mit.edu>1998-02-20 00:06:11 +0000
committerTom Yu <tlyu@mit.edu>1998-02-20 00:06:11 +0000
commit096f00e1426533d92fd75865baf7b3cd34ed6458 (patch)
tree7a4406ed152ee6fd20fde061df443ce1c9fd5b58 /src/lib
parent5c6aca0ac88a684b94eeabf428be7787b6fdb912 (diff)
downloadkrb5-096f00e1426533d92fd75865baf7b3cd34ed6458.tar.gz
krb5-096f00e1426533d92fd75865baf7b3cd34ed6458.tar.xz
krb5-096f00e1426533d92fd75865baf7b3cd34ed6458.zip
* recvauth.c (krb5_recvauth): Add some bookkeeping flags so we
know how much stuff to free upon cleanup. Fix the up cleanup code. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@10465 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/krb5/krb/ChangeLog6
-rw-r--r--src/lib/krb5/krb/recvauth.c13
2 files changed, 16 insertions, 3 deletions
diff --git a/src/lib/krb5/krb/ChangeLog b/src/lib/krb5/krb/ChangeLog
index a4053da26..48278958e 100644
--- a/src/lib/krb5/krb/ChangeLog
+++ b/src/lib/krb5/krb/ChangeLog
@@ -1,3 +1,9 @@
+Thu Feb 19 19:03:20 1998 Tom Yu <tlyu@mit.edu>
+
+ * recvauth.c (krb5_recvauth): Add some bookkeeping flags so we
+ know how much stuff to free upon cleanup. Fix the up cleanup
+ code.
+
Wed Feb 18 16:24:02 1998 Tom Yu <tlyu@mit.edu>
* Makefile.in: Remove trailing slash from thisconfigdir. Fix up
diff --git a/src/lib/krb5/krb/recvauth.c b/src/lib/krb5/krb/recvauth.c
index 5bde73aa4..8ee99fbb1 100644
--- a/src/lib/krb5/krb/recvauth.c
+++ b/src/lib/krb5/krb/recvauth.c
@@ -58,6 +58,7 @@ krb5_recvauth(context, auth_context,
krb5_octet response;
krb5_data null_server;
int need_error_free = 0;
+ int local_rcache = 0, local_authcon = 0;
/*
* Zero out problem variable. If problem is set at the end of
@@ -141,8 +142,10 @@ krb5_recvauth(context, auth_context,
if (*auth_context == NULL) {
problem = krb5_auth_con_init(context, &new_auth_context);
*auth_context = new_auth_context;
+ local_authcon = 1;
}
- if ((!problem) && ((*auth_context)->rcache == NULL)) {
+ krb5_auth_con_getrcache(context, *auth_context, &rcache);
+ if ((!problem) && rcache == NULL) {
/*
* Setup the replay cache.
*/
@@ -156,6 +159,7 @@ krb5_recvauth(context, auth_context,
}
if (!problem)
problem = krb5_auth_con_setrcache(context, *auth_context, rcache);
+ local_rcache = 1;
}
if (!problem) {
problem = krb5_rd_req(context, auth_context, &inbuf, server,
@@ -227,9 +231,12 @@ krb5_recvauth(context, auth_context,
cleanup:;
if (retval) {
- if (rcache)
+ if (local_authcon) {
+ krb5_auth_con_free(context, *auth_context);
+ } else if (local_rcache && rcache != NULL) {
krb5_rc_close(context, rcache);
- krb5_auth_con_free(context, *auth_context);
+ krb5_auth_con_setrcache(context, *auth_context, NULL);
+ }
}
return retval;
}