* error_message.c (com_err_terminate): Lock the list mutex before walking
authorKen Raeburn <raeburn@mit.edu>
Fri, 14 Jan 2005 03:15:41 +0000 (03:15 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 14 Jan 2005 03:15:41 +0000 (03:15 +0000)
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
src/util/et/error_message.c

index e9b0e232b1a6ff80b50a4ab4cbea63b3170e61e6..eeec13ebd7510e0723629fb070ec68d60b0212fb 100644 (file)
@@ -1,3 +1,8 @@
+2005-01-13  Ken Raeburn  <raeburn@mit.edu>
+
+       * error_message.c (com_err_terminate): Lock the list mutex before
+       walking through it; unlock and destroy it afterwards.
+
 2004-11-05  Ken Raeburn  <raeburn@mit.edu>
 
        * et_h.awk: Declare initialize_*_error_table as taking no
index 42c230051ff69b2b29b548e329042bd27d1dc367..8bef6804d9507dd65c8f98bdfd204a12a2e70168 100644 (file)
@@ -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;
 }