]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/schema_init.c
Use recursive mutex to avoid deadlocks
[openldap] / servers / slapd / schema_init.c
index 39952664dbf8966fed66c3c3eb3010e40d704141..fe237767a4ec85d2adb273a7b599d26ca296eafa 100644 (file)
@@ -4681,6 +4681,8 @@ schema_destroy( void )
        mru_destroy();
        syn_destroy();
 
-       ldap_pvt_thread_mutex_destroy( &ad_undef_mutex );
-       ldap_pvt_thread_mutex_destroy( &oc_undef_mutex );
+       if( schema_init_done ) {
+               ldap_pvt_thread_mutex_destroy( &ad_undef_mutex );
+               ldap_pvt_thread_mutex_destroy( &oc_undef_mutex );
+       }
 }