From ddb43b83d4856800ea36750eb3ea8410031c73e0 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sat, 9 Aug 2008 12:49:44 +0000 Subject: [PATCH] don't copy strings if not necessary --- servers/slapd/acl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); -- 2.39.5