Fix bug of trying to use freed memory
authorTheodore Tso <tytso@mit.edu>
Sat, 20 Aug 1994 05:36:24 +0000 (05:36 +0000)
committerTheodore Tso <tytso@mit.edu>
Sat, 20 Aug 1994 05:36:24 +0000 (05:36 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4202 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/rcache/ChangeLog
src/lib/krb5/rcache/rc_dfl.c

index d51d51a084c52d2624f636a6a4bb306a97ee5c90..47f3f1e00506c898b1966b14fad352edfde3e79b 100644 (file)
@@ -1,3 +1,9 @@
+Sat Aug 20 00:09:37 1994  Theodore Y. Ts'o  (tytso at tsx-11)
+
+       * rc_dfl.c (krb5_rc_dfl_expunge): name (t->name) was getting freed
+       and we tried to use it.  Clear t->name to stop it from being
+       freed, and then free it later.
+
 Mon Jun 20 19:37:13 1994  Theodore Y. Ts'o  (tytso at tsx-11)
 
        * rc_base.h: #include <krb5/osconf.h> so that build works using imake. 
index 19586ba3aac43f4818a150415a62c3c8a41e905e..b9ebb91472d5263b6521e2362b873337dab464fe 100644 (file)
@@ -538,13 +538,16 @@ krb5_rcache id;
   
 #else
     struct authlist *q;
-    char *name = t->name;
+    char *name;
     krb5_error_code retval;
     krb5_rcache tmp;
     krb5_deltat lifespan = t->lifespan;  /* save original lifespan */
 
+    name = t->name;
+    t->name = 0;               /* Clear name so it isn't freed */
     (void) krb5_rc_dfl_close_no_free(id);
     retval = krb5_rc_dfl_resolve(id, name);
+    free(name);
     if (retval)
        return retval;
     retval = krb5_rc_dfl_recover(id);