From fe911c59609aeea8b688282a834a0d0748676390 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Sat, 14 Nov 2009 09:34:29 +0000 Subject: [PATCH] ITS#6376 plug potential leak --- servers/slapd/overlays/syncprov.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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; } -- 2.39.5