diff options
author | Greg Hudson <ghudson@mit.edu> | 2011-07-21 18:17:38 +0000 |
---|---|---|
committer | Greg Hudson <ghudson@mit.edu> | 2011-07-21 18:17:38 +0000 |
commit | 291dbbf021e83a20df2f9f488953a278e5664f20 (patch) | |
tree | e00808adad5ccfc00fa3dd00ea038dcd3bcddf57 /src | |
parent | 057760c30b21a93819abc464113c9d64dd8cfb87 (diff) | |
download | krb5-291dbbf021e83a20df2f9f488953a278e5664f20.tar.gz krb5-291dbbf021e83a20df2f9f488953a278e5664f20.tar.xz krb5-291dbbf021e83a20df2f9f488953a278e5664f20.zip |
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
Diffstat (limited to 'src')
-rw-r--r-- | src/util/profile/prof_init.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 { |