svn rev #25031: trunk/src/util/profile/

ghudson@MIT.EDU ghudson at MIT.EDU
Thu Jul 21 14:17:39 EDT 2011


http://src.mit.edu/fisheye/changelog/krb5/?cs=25031
Commit By: ghudson
Log Message:
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.


Changed Files:
U   trunk/src/util/profile/prof_init.c
Modified: trunk/src/util/profile/prof_init.c
===================================================================
--- trunk/src/util/profile/prof_init.c	2011-07-20 22:40:46 UTC (rev 25030)
+++ trunk/src/util/profile/prof_init.c	2011-07-21 18:17:38 UTC (rev 25031)
@@ -481,8 +481,11 @@
             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 {




More information about the cvs-krb5 mailing list