From: Howard Chu Date: Sat, 14 Nov 2009 09:34:29 +0000 (+0000) Subject: ITS#6376 plug potential leak X-Git-Tag: ACLCHECK_0~128 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fe911c59609aeea8b688282a834a0d0748676390;p=openldap ITS#6376 plug potential leak --- diff --git a/servers/slapd/overlays/syncprov.c b/servers/slapd/overlays/syncprov.c index 354867ee65..a722bae7aa 100644 --- a/servers/slapd/overlays/syncprov.c +++ b/servers/slapd/overlays/syncprov.c @@ -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; }