From: Howard Chu Date: Thu, 18 Sep 2014 01:06:38 +0000 (+0100) Subject: ITS#7942 plug leak in controls X-Git-Tag: OPENLDAP_REL_ENG_2_4_40~4 X-Git-Url: https://git.sur5r.net/?p=openldap;a=commitdiff_plain;h=ffd0f03bb5339fa9e4029ac742132c43d69f0f78 ITS#7942 plug leak in controls --- diff --git a/servers/slapd/controls.c b/servers/slapd/controls.c index 4ed535cd2c..48d839af4d 100644 --- a/servers/slapd/controls.c +++ b/servers/slapd/controls.c @@ -565,6 +565,27 @@ void slap_free_ctrls( { int i; + if( op->o_assertion != NULL ) { + filter_free_x( op, op->o_assertion, 1 ); + op->o_assertion = NULL; + } + if( op->o_vrFilter != NULL) { + vrFilter_free( op, op->o_vrFilter ); + op->o_vrFilter = NULL; + } + if( op->o_preread_attrs != NULL ) { + op->o_tmpfree( op->o_preread_attrs, op->o_tmpmemctx ); + op->o_preread_attrs = NULL; + } + if( op->o_postread_attrs != NULL ) { + op->o_tmpfree( op->o_postread_attrs, op->o_tmpmemctx ); + op->o_postread_attrs = NULL; + } + if( op->o_pagedresults_state != NULL ) { + op->o_tmpfree( op->o_pagedresults_state, op->o_tmpmemctx ); + op->o_pagedresults_state = NULL; + } + for (i=0; ctrls[i]; i++) { op->o_tmpfree(ctrls[i], op->o_tmpmemctx ); }