From a79f9ab0248b3a5dcb6b962eb1d6fb1cacf30eb7 Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Sun, 12 Jan 2003 13:07:49 +0000 Subject: [PATCH] * kdc_util.h, replay.c, main.c: Pass global krb5_context to kdc_free_lookaside() instead of per realm one - which has been freed by time invoked. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@15113 dc483132-0cff-0310-8789-dd5450dbe970 --- src/kdc/ChangeLog | 6 ++++++ src/kdc/kdc_util.h | 2 +- src/kdc/main.c | 4 ++-- src/kdc/replay.c | 8 ++++---- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/src/kdc/ChangeLog b/src/kdc/ChangeLog index 0e58dece8..498a1efa1 100644 --- a/src/kdc/ChangeLog +++ b/src/kdc/ChangeLog @@ -1,3 +1,9 @@ +2003-01-12 Ezra Peisach + + * kdc_util.h, replay.c, main.c: Pass global krb5_context to + kdc_free_lookaside() instead of per realm one - which has been + freed by time invoked. + 2003-01-03 Ezra Peisach * main.c: On exit, free more allocated memory, including: diff --git a/src/kdc/kdc_util.h b/src/kdc/kdc_util.h index 11a916078..9abe3b860 100644 --- a/src/kdc/kdc_util.h +++ b/src/kdc/kdc_util.h @@ -158,7 +158,7 @@ krb5_boolean kdc_check_lookaside (krb5_data *, const krb5_fulladdr *, krb5_data **); void kdc_insert_lookaside (krb5_data *, const krb5_fulladdr *, krb5_data *); -void kdc_free_lookaside(void); +void kdc_free_lookaside(krb5_context); /* sock2p.c */ extern void sockaddr2p (const struct sockaddr *, char *, size_t, int *); diff --git a/src/kdc/main.c b/src/kdc/main.c index c338b53a8..4619124f2 100644 --- a/src/kdc/main.c +++ b/src/kdc/main.c @@ -845,10 +845,10 @@ int main(int argc, char **argv) if (kdc_realmlist) free(kdc_realmlist); #ifdef USE_RCACHE - (void) krb5_rc_close(kdc_context, kdc_rcache); + (void) krb5_rc_close(kcontext, kdc_rcache); #endif #ifndef NOCACHE - kdc_free_lookaside(); + kdc_free_lookaside(kcontext); #endif krb5_free_context(kcontext); return errout; diff --git a/src/kdc/replay.c b/src/kdc/replay.c index 18210b8c1..736abb73b 100644 --- a/src/kdc/replay.c +++ b/src/kdc/replay.c @@ -170,15 +170,15 @@ kdc_insert_lookaside(krb5_data *inpkt, const krb5_fulladdr *from, /* frees memory associated with the lookaside queue for memory profiling */ void -kdc_free_lookaside() +kdc_free_lookaside(krb5_context kcontext) { register krb5_kdc_replay_ent *eptr, *last, *hold; if (root_ptr.next) { for (last = &root_ptr, eptr = root_ptr.next; eptr; eptr = eptr->next) { - krb5_free_data(kdc_context, eptr->req_packet); - krb5_free_data(kdc_context, eptr->reply_packet); - krb5_free_address(kdc_context, eptr->addr); + krb5_free_data(kcontext, eptr->req_packet); + krb5_free_data(kcontext, eptr->reply_packet); + krb5_free_address(kcontext, eptr->addr); hold = eptr; last->next = eptr->next; eptr = last; -- 2.26.2