From 938778ffd94c350b6ab475a32691f64c465446ed Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Sun, 29 Aug 2010 17:23:08 +0000 Subject: [PATCH] free controls, if needed (ITS#6629) --- servers/slapd/result.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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; } -- 2.39.5