]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/back-meta/map.c
Merge remote branch 'origin/mdb.master'
[openldap] / servers / slapd / back-meta / map.c
index e90d3dd187348e0844e5bf2c037183537d37e7e5..7bb172469b7362a308d468688d1351765d9887d3 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2010 The OpenLDAP Foundation.
+ * Copyright 1998-2011 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -61,9 +61,6 @@
 #include "../back-ldap/back-ldap.h"
 #include "back-meta.h"
 
-#undef ldap_debug      /* silence a warning in ldap-int.h */
-#include "../../../libraries/libldap/ldap-int.h"
-
 int
 mapping_cmp ( const void *c1, const void *c2 )
 {
@@ -301,7 +298,9 @@ map_attr_value(
                        return -1;
                }
 
-       } else if ( ad->ad_type->sat_equality->smr_usage & SLAP_MR_MUTATION_NORMALIZER ) {
+       } else if ( ad->ad_type->sat_equality && 
+               ad->ad_type->sat_equality->smr_usage & SLAP_MR_MUTATION_NORMALIZER )
+       {
                if ( ad->ad_type->sat_equality->smr_normalize(
                        (SLAP_MR_DENORMALIZE|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX),
                        NULL, NULL, value, &vtmp, memctx ) )
@@ -742,7 +741,7 @@ ldap_back_referral_result_rewrite(
                         * legal to trim values when adding/modifying;
                         * it should be when searching (e.g. ACLs).
                         */
-                       LBER_FREE( a_vals[ i ].bv_val );
+                       ber_memfree( a_vals[ i ].bv_val );
                        if ( last > i ) {
                                a_vals[ i ] = a_vals[ last ];
                        }
@@ -855,7 +854,7 @@ ldap_dnattr_result_rewrite(
                         * legal to trim values when adding/modifying;
                         * it should be when searching (e.g. ACLs).
                         */
-                       LBER_FREE( a_vals[i].bv_val );
+                       ber_memfree( a_vals[i].bv_val );
                        if ( last > i ) {
                                a_vals[i] = a_vals[last];
                        }
@@ -866,7 +865,7 @@ ldap_dnattr_result_rewrite(
                default:
                        /* leave attr untouched if massage failed */
                        if ( !BER_BVISNULL( &bv ) && a_vals[i].bv_val != bv.bv_val ) {
-                               LBER_FREE( a_vals[i].bv_val );
+                               ber_memfree( a_vals[i].bv_val );
                                a_vals[i] = bv;
                        }
                        break;