From: Jeffrey Altman Date: Sat, 15 Jan 2005 21:40:23 +0000 (+0000) Subject: * rc_dfl.c: Move the extraction of the struct dfl_data X-Git-Tag: ms-bug-test-20060525~370 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2656e5e1e026f800559eed79dfcc58cd3da5d9a0;p=krb5.git * rc_dfl.c: Move the extraction of the struct dfl_data from the krb5_rcache after obtaining the lock, not before. ticket: new target_version: 1.4 tags: pullup git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17046 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog index 24b04b015..597ce15e6 100644 --- a/src/lib/krb5/rcache/ChangeLog +++ b/src/lib/krb5/rcache/ChangeLog @@ -1,3 +1,8 @@ +2005-01-15 Jeffrey Altman + + * rc_dfl.c: Move the extraction of the struct dfl_data + from the krb5_rcache after obtaining the lock, not before. + 2004-08-03 Ken Raeburn * rc-int.h (struct _krb5_rc_ops): Add new member, diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index 586716a3d..a334002e0 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -182,10 +182,10 @@ krb5_rc_dfl_get_span(krb5_context context, krb5_rcache id, krb5_error_code err; struct dfl_data *t; - t = (struct dfl_data *) id->data; err = k5_mutex_lock(&id->lock); if (err) return err; + t = (struct dfl_data *) id->data; *lifespan = t->lifespan; k5_mutex_unlock(&id->lock); return 0; @@ -514,7 +514,6 @@ krb5_error_code KRB5_CALLCONV krb5_rc_dfl_recover_or_init(krb5_context context, krb5_rcache id, krb5_deltat lifespan) { - struct dfl_data *t = (struct dfl_data *)id->data; krb5_error_code retval; retval = k5_mutex_lock(&id->lock); @@ -561,7 +560,7 @@ krb5_error_code KRB5_CALLCONV krb5_rc_dfl_store(krb5_context context, krb5_rcache id, krb5_donot_replay *rep) { krb5_error_code ret; - struct dfl_data *t = (struct dfl_data *)id->data; + struct dfl_data *t; krb5_int32 now; ret = krb5_timeofday(context, &now); @@ -582,6 +581,7 @@ krb5_rc_dfl_store(krb5_context context, krb5_rcache id, krb5_donot_replay *rep) case 0: break; default: /* wtf? */ ; } + t = (struct dfl_data *)id->data; #ifndef NOIOSTUFF ret = krb5_rc_io_store(context, t, rep); if (ret) {