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
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 {