* cc_file.c (dereference): Lock mutex around call to krb5_fcc_close_file
authorKen Raeburn <raeburn@mit.edu>
Sun, 15 Aug 2004 23:10:35 +0000 (23:10 +0000)
committerKen Raeburn <raeburn@mit.edu>
Sun, 15 Aug 2004 23:10:35 +0000 (23:10 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@16664 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/ccache/ChangeLog
src/lib/krb5/ccache/cc_file.c

index f685331a762fe437e254353989d373a8e8b2aacf..b7594a203be9d2e31c2ad8ac902e5e96d220518f 100644 (file)
@@ -1,3 +1,8 @@
+2004-08-15  Ken Raeburn  <raeburn@mit.edu>
+
+       * cc_file.c (dereference): Lock mutex around call to
+       krb5_fcc_close_file.
+
 2004-08-12  Ken Raeburn  <raeburn@mit.edu>
 
        * cc_file.c (krb5_fcc_close_file): Change first argument to be an
index ee8a7a86d72f7bca979ccbf77bc36666c3957dfd..5776e29e4ab98dee9a2caa408753334ae1700f2c 100644 (file)
@@ -1395,8 +1395,11 @@ static krb5_error_code dereference(krb5_context context, krb5_fcc_data *data)
        *fccsp = (*fccsp)->next;
        k5_mutex_unlock(&krb5int_cc_file_mutex);
        free(data->filename);
-       if (data->file >= 0)
+       if (data->file >= 0) {
+           k5_mutex_lock(&data->lock);
            krb5_fcc_close_file(context, data);
+           k5_mutex_unlock(&data->lock);
+       }
        k5_mutex_assert_unlocked(&data->lock);
        k5_mutex_destroy(&data->lock);
        free(data);