From dbe99f9b8db7711cba4a00aff55046a201f16ddb Mon Sep 17 00:00:00 2001 From: Ken Raeburn Date: Fri, 14 Jan 2005 03:15:41 +0000 Subject: [PATCH] * error_message.c (com_err_terminate): Lock the list mutex before walking through it; unlock and destroy it afterwards. ticket: 2878 status: open git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@17030 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/et/ChangeLog | 5 +++++ src/util/et/error_message.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/util/et/ChangeLog b/src/util/et/ChangeLog index e9b0e232b..eeec13ebd 100644 --- a/src/util/et/ChangeLog +++ b/src/util/et/ChangeLog @@ -1,3 +1,8 @@ +2005-01-13 Ken Raeburn + + * error_message.c (com_err_terminate): Lock the list mutex before + walking through it; unlock and destroy it afterwards. + 2004-11-05 Ken Raeburn * et_h.awk: Declare initialize_*_error_table as taking no diff --git a/src/util/et/error_message.c b/src/util/et/error_message.c index 42c230051..8bef6804d 100644 --- a/src/util/et/error_message.c +++ b/src/util/et/error_message.c @@ -62,11 +62,13 @@ void com_err_terminate(void) struct dynamic_et_list *e, *enext; if (! INITIALIZER_RAN(com_err_initialize) || PROGRAM_EXITING()) return; - k5_mutex_destroy(&et_list_lock); + k5_mutex_lock(&et_list_lock); for (e = et_list_dynamic; e; e = enext) { enext = e->next; free(e); } + k5_mutex_unlock(&et_list_lock); + k5_mutex_destroy(&et_list_lock); terminated = 1; } -- 2.26.2