]> git.sur5r.net Git - openldap/blobdiff - libraries/librewrite/info.c
don't trust strchr/strrchr with bervals
[openldap] / libraries / librewrite / info.c
index aa07e3921b515701f0592a8a0c726d33861252a5..32b5544ebf08dbc21068374863126f4702e5acc0 100644 (file)
@@ -1,7 +1,7 @@
 /* $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
@@ -81,10 +81,13 @@ rewrite_info_init(
 
 #ifdef USE_REWRITE_LDAP_PVT_THREADS
        if ( ldap_pvt_thread_rdwr_init( &info->li_cookies_mutex ) ) {
+               avl_free( info->li_context, rewrite_context_free );
                free( info );
                return NULL;
        }
        if ( ldap_pvt_thread_rdwr_init( &info->li_params_mutex ) ) {
+               ldap_pvt_thread_rdwr_destroy( &info->li_cookies_mutex );
+               avl_free( info->li_context, rewrite_context_free );
                free( info );
                return NULL;
        }
@@ -116,7 +119,7 @@ rewrite_info_delete(
        if ( info->li_maps ) {
                avl_free( info->li_maps, rewrite_builtin_map_free );
        }
-       info->li_context = NULL;
+       info->li_maps = NULL;
 
        rewrite_session_destroy( info );