]> git.sur5r.net Git - openldap/commitdiff
ITS#4532: check *pre/postread_ctrl before freeing
authorRalf Haferkamp <ralf@openldap.org>
Wed, 10 May 2006 09:07:37 +0000 (09:07 +0000)
committerRalf Haferkamp <ralf@openldap.org>
Wed, 10 May 2006 09:07:37 +0000 (09:07 +0000)
servers/slapd/back-bdb/add.c
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c

index 88b61cc819845fdb06bf0ec4520e06e30df039ef..fabf6b12c6ab917b2bcb3654b2362126c43e6d8e 100644 (file)
@@ -459,7 +459,7 @@ return_results:
        }
        op->o_private = NULL;
 
-       if( postread_ctrl != NULL ) {
+       if( postread_ctrl != NULL && (*postread_ctrl) != NULL ) {
                slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *postread_ctrl, op->o_tmpmemctx );
        }
index 97c3c613ee8fe4b3e17f73a2b339f7af0ed407e4..2e715f8050f7fb31d5ca8c5f6a0146947f40b082 100644 (file)
@@ -571,7 +571,7 @@ return_results:
        send_ldap_result( op, rs );
        slap_graduate_commit_csn( op );
 
-       if( preread_ctrl != NULL ) {
+       if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
                slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *preread_ctrl, op->o_tmpmemctx );
        }
index 094f0915dc3837604c56d3b47e7c285bd5507f3b..9967bdb80637f24865dc25d9d11de84e8e3091e4 100644 (file)
@@ -649,11 +649,11 @@ done:
                bdb_unlocked_cache_return_entry_w (&bdb->bi_cache, e);
        }
 
-       if( preread_ctrl != NULL ) {
+       if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
                slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *preread_ctrl, op->o_tmpmemctx );
        }
-       if( postread_ctrl != NULL ) {
+       if( postread_ctrl != NULL && (*postread_ctrl) != NULL ) {
                slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *postread_ctrl, op->o_tmpmemctx );
        }
index cb557832f8f8981d6cbad7fedf78e0a2fab6298e..6aececa31ef7629efc7df70c16b199213875c43f 100644 (file)
@@ -811,11 +811,11 @@ done:
        }
        op->o_private = NULL;
 
-       if( preread_ctrl != NULL ) {
+       if( preread_ctrl != NULL && (*preread_ctrl) != NULL ) {
                slap_sl_free( (*preread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *preread_ctrl, op->o_tmpmemctx );
        }
-       if( postread_ctrl != NULL ) {
+       if( postread_ctrl != NULL && (*postread_ctrl) != NULL ) {
                slap_sl_free( (*postread_ctrl)->ldctl_value.bv_val, op->o_tmpmemctx );
                slap_sl_free( *postread_ctrl, op->o_tmpmemctx );
        }