From c3cc0eff87038ed30e63c45dab99eead07079523 Mon Sep 17 00:00:00 2001 From: Theodore Tso Date: Sat, 20 Aug 1994 05:36:24 +0000 Subject: [PATCH] Fix bug of trying to use freed memory git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4202 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/rcache/ChangeLog | 6 ++++++ src/lib/krb5/rcache/rc_dfl.c | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/lib/krb5/rcache/ChangeLog b/src/lib/krb5/rcache/ChangeLog index d51d51a08..47f3f1e00 100644 --- a/src/lib/krb5/rcache/ChangeLog +++ b/src/lib/krb5/rcache/ChangeLog @@ -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 so that build works using imake. diff --git a/src/lib/krb5/rcache/rc_dfl.c b/src/lib/krb5/rcache/rc_dfl.c index 19586ba3a..b9ebb9147 100644 --- a/src/lib/krb5/rcache/rc_dfl.c +++ b/src/lib/krb5/rcache/rc_dfl.c @@ -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); -- 2.26.2