From 291dbbf021e83a20df2f9f488953a278e5664f20 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Thu, 21 Jul 2011 18:17:38 +0000 Subject: [PATCH] Fix profile_abandon() management lib_handle lock It wasn't unlocking the mutex after decrementing the refcount and wasn't destroying the mutex before freeing the handle. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25031 dc483132-0cff-0310-8789-dd5450dbe970 --- src/util/profile/prof_init.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 959598e42..bbb7f88fd 100644 --- a/src/util/profile/prof_init.c +++ b/src/util/profile/prof_init.c @@ -481,8 +481,11 @@ profile_abandon(profile_t profile) err = k5_mutex_lock(&profile->lib_handle->lock); if (!err && --profile->lib_handle->refcount == 0) { krb5int_close_plugin(profile->lib_handle->plugin_handle); + k5_mutex_unlock(&profile->lib_handle->lock); + k5_mutex_destroy(&profile->lib_handle->lock); free(profile->lib_handle); - } + } else if (!err) + k5_mutex_unlock(&profile->lib_handle->lock); } free(profile->vt); } else { -- 2.26.2