ITS#6376 plug potential leak

This commit is contained in:
Howard Chu 2009-11-14 09:34:29 +00:00
parent d6fbe1c7ca
commit fe911c5960

View file

@ -855,7 +855,15 @@ syncprov_sendresp( Operation *op, opcookie *opc, syncops *so,
}
/* In case someone else freed it already? */
if ( rs.sr_ctrls ) {
op->o_tmpfree( rs.sr_ctrls[0], op->o_tmpmemctx );
int i;
for ( i=0; rs.sr_ctrls[i]; i++ ) {
if ( rs.sr_ctrls[i] == ctrls[0] ) {
op->o_tmpfree( ctrls[0]->ldctl_value.bv_val, op->o_tmpmemctx );
ctrls[0]->ldctl_value.bv_val = NULL;
break;
}
}
slap_free_ctrls( op, rs.sr_ctrls );
rs.sr_ctrls = NULL;
}