mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-12 10:54:48 +08:00
Revert "ITS#7292 plug memleak in control values"
This reverts commit 9e3af2356b
.
This commit is contained in:
parent
96876a171a
commit
a766cdf268
@ -566,24 +566,11 @@ void slap_free_ctrls(
|
||||
int i;
|
||||
|
||||
for (i=0; ctrls[i]; i++) {
|
||||
op->o_tmpfree( ctrls[i], op->o_tmpmemctx );
|
||||
op->o_tmpfree(ctrls[i], op->o_tmpmemctx );
|
||||
}
|
||||
op->o_tmpfree( ctrls, op->o_tmpmemctx );
|
||||
}
|
||||
|
||||
void slap_free_ctrl_vals(
|
||||
Operation *op,
|
||||
LDAPControl **ctrls )
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i=0; ctrls[i]; i++) {
|
||||
if ( ctrls[i]->ldctl_value.bv_val )
|
||||
op->o_tmpfree( ctrls[i]->ldctl_value.bv_val, op->o_tmpmemctx );
|
||||
}
|
||||
slap_free_ctrls( op, ctrls );
|
||||
}
|
||||
|
||||
int slap_add_ctrls(
|
||||
Operation *op,
|
||||
SlapReply *rs,
|
||||
|
@ -638,9 +638,6 @@ LDAP_SLAPD_V( struct slap_control_ids ) slap_cids;
|
||||
LDAP_SLAPD_F (void) slap_free_ctrls LDAP_P((
|
||||
Operation *op,
|
||||
LDAPControl **ctrls ));
|
||||
LDAP_SLAPD_F (void) slap_free_ctrl_vals LDAP_P((
|
||||
Operation *op,
|
||||
LDAPControl **ctrls ));
|
||||
LDAP_SLAPD_F (int) slap_add_ctrls LDAP_P((
|
||||
Operation *op,
|
||||
SlapReply *rs,
|
||||
|
@ -752,7 +752,7 @@ clean2:;
|
||||
if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) {
|
||||
rs->sr_flags ^= REP_CTRLS_MUSTBEFREED; /* paranoia */
|
||||
if ( rs->sr_ctrls ) {
|
||||
slap_free_ctrl_vals( op, rs->sr_ctrls );
|
||||
slap_free_ctrls( op, rs->sr_ctrls );
|
||||
rs->sr_ctrls = NULL;
|
||||
}
|
||||
}
|
||||
@ -1476,7 +1476,7 @@ error_return:;
|
||||
if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) {
|
||||
rs->sr_flags ^= REP_CTRLS_MUSTBEFREED; /* paranoia */
|
||||
if ( rs->sr_ctrls ) {
|
||||
slap_free_ctrl_vals( op, rs->sr_ctrls );
|
||||
slap_free_ctrls( op, rs->sr_ctrls );
|
||||
rs->sr_ctrls = NULL;
|
||||
}
|
||||
}
|
||||
@ -1637,7 +1637,7 @@ rel:
|
||||
if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) {
|
||||
rs->sr_flags ^= REP_CTRLS_MUSTBEFREED; /* paranoia */
|
||||
if ( rs->sr_ctrls ) {
|
||||
slap_free_ctrl_vals( op, rs->sr_ctrls );
|
||||
slap_free_ctrls( op, rs->sr_ctrls );
|
||||
rs->sr_ctrls = NULL;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user