/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2004 The OpenLDAP Foundation.
+ * Copyright 2000-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
struct rewrite_session *session
)
{
- assert( session );
+ assert( session != NULL );
ldap_pvt_thread_mutex_unlock( &session->ls_mutex );
}
session = rewrite_session_find( info, cookie );
if ( session == NULL ) {
session = rewrite_session_init( info, cookie );
+ if ( session == NULL ) {
+ return REWRITE_ERR;
+ }
+
+#ifdef USE_REWRITE_LDAP_PVT_THREADS
+ ldap_pvt_thread_mutex_lock( &session->ls_mutex );
+#endif /* USE_REWRITE_LDAP_PVT_THREADS */
}
#ifdef USE_REWRITE_LDAP_PVT_THREADS