From: Pierangelo Masarati Date: Sat, 9 Aug 2008 12:49:44 +0000 (+0000) Subject: don't copy strings if not necessary X-Git-Tag: LOCKER_IDS~5 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=ddb43b83d4856800ea36750eb3ea8410031c73e0;p=openldap don't copy strings if not necessary --- diff --git a/servers/slapd/acl.c b/servers/slapd/acl.c index 7f97d57cf4..886aa926ad 100644 --- a/servers/slapd/acl.c +++ b/servers/slapd/acl.c @@ -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);