]> git.sur5r.net Git - openldap/commitdiff
free controls, if needed (ITS#6629)
authorPierangelo Masarati <ando@openldap.org>
Sun, 29 Aug 2010 17:23:08 +0000 (17:23 +0000)
committerPierangelo Masarati <ando@openldap.org>
Sun, 29 Aug 2010 17:23:08 +0000 (17:23 +0000)
servers/slapd/result.c

index 38152e019454e7d62de04959bbff7fe3bf29b8be..c984863bc4ae89a21619e99ca60dc923f37a247e 100644 (file)
@@ -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;
 }