}
info->li_context = NULL;
+ if ( info->li_maps ) {
+ avl_free( info->li_maps, rewrite_builtin_map_free );
+ }
+ info->li_context = NULL;
+
rewrite_session_destroy( info );
#ifdef USE_REWRITE_LDAP_PVT_THREADS
)
{
struct rewrite_context *context;
- struct rewrite_op op = { 0, 0, NULL, NULL, NULL, NULL };
+ struct rewrite_op op = { 0, 0, NULL, NULL, NULL };
int rc;
assert( info != NULL );
break;
}
}
-
+
+#if 0 /* FIXME: not used anywhere! (debug? then, why strdup?) */
op.lo_string = strdup( string );
if ( op.lo_string == NULL ) {
rc = REWRITE_REGEXEC_ERR;
goto rc_return;
}
+#endif
/*
* Applies rewrite context
*/
- rc = rewrite_context_apply(info, &op, context, string, result );
+ rc = rewrite_context_apply( info, &op, context, string, result );
assert( op.lo_depth == 0 );
- /* ?!? */
+#if 0 /* FIXME: not used anywhere! (debug? then, why strdup?) */
free( op.lo_string );
+#endif
switch ( rc ) {
/*
return rc;
}
+void
+rewrite_builtin_map_free(
+ void *tmp
+)
+{
+ struct rewrite_builtin_map *map = ( struct rewrite_builtin_map * )tmp;
+
+ assert( map );
+
+ switch ( map->lb_type ) {
+ case REWRITE_BUILTIN_MAP_LDAP:
+ map_ldap_destroy( &map );
+ break;
+
+ default:
+ assert(0);
+ break;
+ }
+
+ free( map );
+}
+
int
rewrite_map_destroy(
struct rewrite_map **pmap
return NULL;
}
memset( var, 0, sizeof( struct rewrite_var ) );
- var->lv_name = ( char * )strdup( name );
+ var->lv_name = strdup( name );
if ( var->lv_name == NULL ) {
rc = -1;
goto cleanup;
free( var->lv_name );
free( var->lv_value.bv_val );
+ free( var );
}
/*