mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-24 13:24:56 +08:00
For ITS#5421: Also LBER_FREE() -> ber_memfree()
This commit is contained in:
parent
b39e9d151d
commit
e1469fff44
@ -790,7 +790,7 @@ ldap_build_entry(
|
||||
rc = LDAP_SUCCESS;
|
||||
|
||||
} else {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
if ( --last == i ) {
|
||||
BER_BVZERO( &attr->a_vals[i] );
|
||||
break;
|
||||
@ -802,7 +802,7 @@ ldap_build_entry(
|
||||
}
|
||||
|
||||
if ( rc == LDAP_SUCCESS && pretty ) {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
attr->a_vals[i] = pval;
|
||||
}
|
||||
}
|
||||
@ -828,7 +828,7 @@ ldap_build_entry(
|
||||
NULL );
|
||||
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
if ( --last == i ) {
|
||||
BER_BVZERO( &attr->a_vals[i] );
|
||||
break;
|
||||
@ -859,8 +859,8 @@ ldap_build_entry(
|
||||
|
||||
/* Strip duplicate values */
|
||||
if ( attr->a_nvals != attr->a_vals )
|
||||
LBER_FREE( attr->a_nvals[i].bv_val );
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_nvals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
attr->a_numvals--;
|
||||
|
||||
assert( i >= 0 );
|
||||
|
@ -742,7 +742,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 +855,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 +866,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;
|
||||
|
@ -2098,7 +2098,7 @@ remove_oc:;
|
||||
}
|
||||
|
||||
if ( rc ) {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
if ( --last == i ) {
|
||||
BER_BVZERO( &attr->a_vals[ i ] );
|
||||
break;
|
||||
@ -2110,7 +2110,7 @@ remove_oc:;
|
||||
}
|
||||
|
||||
if ( pretty ) {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
attr->a_vals[i] = pval;
|
||||
}
|
||||
}
|
||||
@ -2135,7 +2135,7 @@ remove_oc:;
|
||||
attr->a_desc->ad_type->sat_equality,
|
||||
&attr->a_vals[i], &attr->a_nvals[i],
|
||||
NULL )) {
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
if ( --last == i ) {
|
||||
BER_BVZERO( &attr->a_vals[ i ] );
|
||||
break;
|
||||
@ -2217,8 +2217,8 @@ next_attr:;
|
||||
|
||||
/* Strip duplicate values */
|
||||
if ( attr->a_nvals != attr->a_vals )
|
||||
LBER_FREE( attr->a_nvals[i].bv_val );
|
||||
LBER_FREE( attr->a_vals[i].bv_val );
|
||||
ber_memfree( attr->a_nvals[i].bv_val );
|
||||
ber_memfree( attr->a_vals[i].bv_val );
|
||||
attr->a_numvals--;
|
||||
if ( (unsigned)i < attr->a_numvals ) {
|
||||
attr->a_vals[i] = attr->a_vals[attr->a_numvals];
|
||||
|
Loading…
Reference in New Issue
Block a user