From: Greg Hudson Date: Thu, 21 Jul 2011 18:17:38 +0000 (+0000) Subject: Fix profile_abandon() management lib_handle lock X-Git-Tag: krb5-1.10-alpha1~344 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=291dbbf021e83a20df2f9f488953a278e5664f20;p=thirdparty%2Fkrb5.git 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 --- diff --git a/src/util/profile/prof_init.c b/src/util/profile/prof_init.c index 959598e42a..bbb7f88fd3 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 {