From b8bf18f36b0f4ab11c2c0d85a9992562fd4125fd Mon Sep 17 00:00:00 2001 From: Ralf Haferkamp Date: Wed, 10 May 2006 09:07:37 +0000 Subject: [PATCH] ITS#4532: check *pre/postread_ctrl before freeing --- servers/slapd/back-bdb/add.c | 2 +- servers/slapd/back-bdb/delete.c | 2 +- servers/slapd/back-bdb/modify.c | 4 ++-- servers/slapd/back-bdb/modrdn.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/servers/slapd/back-bdb/add.c b/servers/slapd/back-bdb/add.c index 88b61cc819..fabf6b12c6 100644 --- a/servers/slapd/back-bdb/add.c +++ b/servers/slapd/back-bdb/add.c @@ -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 ); } diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 97c3c613ee..2e715f8050 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -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 ); } diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index 094f0915dc..9967bdb806 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -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 ); } diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index cb557832f8..6aececa31e 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -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 ); } -- 2.39.5