From: Pierangelo Masarati Date: Sun, 29 Aug 2010 17:23:08 +0000 (+0000) Subject: free controls, if needed (ITS#6629) X-Git-Tag: MIGRATION_CVS2GIT~501 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=938778ffd94c350b6ab475a32691f64c465446ed;p=openldap free controls, if needed (ITS#6629) --- diff --git a/servers/slapd/result.c b/servers/slapd/result.c index 38152e0194..c984863bc4 100644 --- a/servers/slapd/result.c +++ b/servers/slapd/result.c @@ -1356,6 +1356,14 @@ error_return:; rs->sr_flags &= ~REP_ENTRY_MUSTBEFREED; } + if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) { + rs->sr_flags ^= REP_CTRLS_MUSTBEFREED; /* paranoia */ + if ( rs->sr_ctrls ) { + slap_free_ctrls( op, rs->sr_ctrls ); + rs->sr_ctrls = NULL; + } + } + return( rc ); } @@ -1510,6 +1518,14 @@ rel: (void)slap_cleanup_play( op, rs ); } + if ( rs->sr_flags & REP_CTRLS_MUSTBEFREED ) { + rs->sr_flags ^= REP_CTRLS_MUSTBEFREED; /* paranoia */ + if ( rs->sr_ctrls ) { + slap_free_ctrls( op, rs->sr_ctrls ); + rs->sr_ctrls = NULL; + } + } + return rc; }