}
static void
-rewrite_session_free( void *v_session )
+rewrite_session_clean( void *v_session )
{
struct rewrite_session *session = (struct rewrite_session *)v_session;
ldap_pvt_thread_mutex_unlock( &session->ls_mutex );
ldap_pvt_thread_mutex_destroy( &session->ls_mutex );
#endif /* USE_REWRITE_LDAP_PVT_THREADS */
+}
- free( session );
+static void
+rewrite_session_free( void *v_session )
+{
+ rewrite_session_clean( v_session );
+ free( v_session );
}
/*
const void *cookie
)
{
- struct rewrite_session *session, tmp;
+ struct rewrite_session *session, tmp = { 0 };
assert( info != NULL );
assert( cookie != NULL );
- tmp.ls_cookie = ( void * )cookie;
-
session = rewrite_session_find( info, cookie );
if ( session == NULL ) {
return REWRITE_SUCCESS;
}
- rewrite_session_free( session );
+ rewrite_session_clean( session );
#ifdef USE_REWRITE_LDAP_PVT_THREADS
ldap_pvt_thread_rdwr_wlock( &info->li_cookies_mutex );
/*
* There is nothing to delete in the return value
*/
+ tmp.ls_cookie = ( void * )cookie;
avl_delete( &info->li_cookies, ( caddr_t )&tmp, rewrite_cookie_cmp );
+
free( session );
#ifdef USE_REWRITE_LDAP_PVT_THREADS