ITS#4532: check *pre/postread_ctrl before freeing

This commit is contained in:
Ralf Haferkamp 2006-05-10 09:07:37 +00:00
parent 4c926910d7
commit b8bf18f36b
4 changed files with 6 additions and 6 deletions

View 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 );
}

View 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 );
}

View 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 );
}

View 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 );
}