]> git.sur5r.net Git - openldap/commitdiff
ITS#7942 plug leak in controls
authorHoward Chu <hyc@openldap.org>
Thu, 18 Sep 2014 01:06:38 +0000 (02:06 +0100)
committerHoward Chu <hyc@openldap.org>
Thu, 18 Sep 2014 01:06:38 +0000 (02:06 +0100)
servers/slapd/controls.c

index 13f0a6eabd96806ec2dedb8da44985d401206cbc..67d8f1608a8a1d0ff2af96b77e8fcaf083ae183a 100644 (file)
@@ -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 );
        }