Remove deference of freed structure
authorTheodore Tso <tytso@mit.edu>
Tue, 21 Sep 1993 23:22:19 +0000 (23:22 +0000)
committerTheodore Tso <tytso@mit.edu>
Tue, 21 Sep 1993 23:22:19 +0000 (23:22 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2645 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/rcache/rc_dfl.c

index de333c00f4ad7ecc54cf047d645d3cae47b26fcb..e667eb17cd13983d9f97bbf66b267f29985630b7 100644 (file)
@@ -499,6 +499,7 @@ krb5_rcache id;
     char *name = t->name;
     krb5_error_code retval;
     krb5_rcache tmp;
+    krb5_deltat lifespan = t->lifespan;  /* save original lifespan */
 
     (void) krb5_rc_dfl_close(id);
     retval = krb5_rc_dfl_resolve(id, name);
@@ -507,6 +508,7 @@ krb5_rcache id;
     retval = krb5_rc_dfl_recover(id);
     if (retval)
        return retval;
+    t = (struct dfl_data *)id->data; /* point to recovered cache */
     tmp = (krb5_rcache) malloc(sizeof(*tmp));
     if (!tmp)
        return ENOMEM;
@@ -516,7 +518,7 @@ krb5_rcache id;
     retval = krb5_rc_resolve(tmp, 0);
     if (retval)
        return retval;
-    retval = krb5_rc_initialize(tmp, t->lifespan);
+    retval = krb5_rc_initialize(tmp, lifespan);
     if (retval)
        return retval;
     for (q = t->a;q;q = q->na) {