]> git.sur5r.net Git - openldap/commitdiff
don't copy strings if not necessary
authorPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 12:49:44 +0000 (12:49 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sat, 9 Aug 2008 12:49:44 +0000 (12:49 +0000)
servers/slapd/acl.c

index 7f97d57cf4c0bc5e9cc14e482c3aaec76f7aff2c..886aa926ad294605a4a09a4e129efe8daac2c045 100644 (file)
@@ -2275,7 +2275,7 @@ acl_match_set (
        AclSetCookie    cookie;
 
        if ( default_set_attribute == NULL ) {
-               ber_dupbv_x( &set, subj, op->o_tmpmemctx );
+               set = *subj;
 
        } else {
                struct berval           subjdn, ndn = BER_BVNULL;
@@ -2324,7 +2324,9 @@ acl_match_set (
                        acl_set_gather,
                        (SetCookie *)&cookie, &set,
                        &op->o_ndn, &e->e_nname, NULL ) > 0 );
-               slap_sl_free( set.bv_val, op->o_tmpmemctx );
+               if ( set.bv_val != subj->bv_val ) {
+                       slap_sl_free( set.bv_val, op->o_tmpmemctx );
+               }
        }
 
        return(rc);