mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
referral mem leak fix
This commit is contained in:
parent
7dc0487341
commit
86aa3728b9
6 changed files with 32 additions and 12 deletions
|
|
@ -142,6 +142,8 @@ retry: /* transaction retry */
|
|||
|
||||
/* FIXME : dn2entry() should return non-glue entry */
|
||||
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
|
||||
BerVarray deref = NULL;
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS,
|
||||
"<=- bdb_delete: no such object %s\n",
|
||||
op->o_req_dn.bv_val, 0, 0);
|
||||
|
|
@ -155,7 +157,6 @@ retry: /* transaction retry */
|
|||
matched = NULL;
|
||||
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -167,7 +168,7 @@ retry: /* transaction retry */
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
rs->sr_err = LDAP_REFERRAL;
|
||||
|
|
@ -176,6 +177,9 @@ retry: /* transaction retry */
|
|||
if ( rs->sr_ref != default_referral ) {
|
||||
ber_bvarray_free( rs->sr_ref );
|
||||
}
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
|
|
|
|||
|
|
@ -381,6 +381,7 @@ retry: /* transaction retry */
|
|||
if (( rs->sr_err == DB_NOTFOUND ) ||
|
||||
( !manageDSAit && e && is_entry_glue( e )))
|
||||
{
|
||||
BerVarray deref = NULL;
|
||||
if ( e != NULL ) {
|
||||
rs->sr_matched = ch_strdup( e->e_dn );
|
||||
rs->sr_ref = is_entry_referral( e )
|
||||
|
|
@ -390,7 +391,6 @@ retry: /* transaction retry */
|
|||
e = NULL;
|
||||
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -402,7 +402,7 @@ retry: /* transaction retry */
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
rs->sr_err = LDAP_REFERRAL;
|
||||
|
|
@ -411,6 +411,9 @@ retry: /* transaction retry */
|
|||
if ( rs->sr_ref != default_referral ) {
|
||||
ber_bvarray_free( rs->sr_ref );
|
||||
}
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
|
|
|
|||
|
|
@ -170,6 +170,7 @@ retry: /* transaction retry */
|
|||
if (( rs->sr_err == DB_NOTFOUND ) ||
|
||||
( !manageDSAit && e && is_entry_glue( e )))
|
||||
{
|
||||
BerVarray deref = NULL;
|
||||
if( e != NULL ) {
|
||||
rs->sr_matched = ch_strdup( e->e_dn );
|
||||
rs->sr_ref = is_entry_referral( e )
|
||||
|
|
@ -179,7 +180,6 @@ retry: /* transaction retry */
|
|||
e = NULL;
|
||||
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -191,13 +191,16 @@ retry: /* transaction retry */
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
rs->sr_err = LDAP_REFERRAL;
|
||||
send_ldap_result( op, rs );
|
||||
|
||||
ber_bvarray_free( rs->sr_ref );
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
|
|
|
|||
|
|
@ -49,6 +49,8 @@ ldbm_back_delete(
|
|||
|
||||
/* FIXME : dn2entry() should return non-glue entry */
|
||||
if ( e == NULL || ( !manageDSAit && is_entry_glue( e ))) {
|
||||
BerVarray deref = NULL;
|
||||
|
||||
Debug(LDAP_DEBUG_ARGS, "<=- ldbm_back_delete: no such object %s\n",
|
||||
op->o_req_dn.bv_val, 0, 0);
|
||||
|
||||
|
|
@ -60,7 +62,6 @@ ldbm_back_delete(
|
|||
cache_return_entry_r( &li->li_cache, matched );
|
||||
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -72,7 +73,7 @@ ldbm_back_delete(
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
|
||||
|
|
@ -81,6 +82,9 @@ ldbm_back_delete(
|
|||
send_ldap_result( op, rs );
|
||||
|
||||
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
|
|
|
|||
|
|
@ -249,6 +249,7 @@ ldbm_back_modify(
|
|||
|
||||
/* FIXME: dn2entry() should return non-glue entry */
|
||||
if (( e == NULL ) || ( !manageDSAit && e && is_entry_glue( e ))) {
|
||||
BerVarray deref = NULL;
|
||||
if ( matched != NULL ) {
|
||||
rs->sr_matched = ch_strdup( matched->e_dn );
|
||||
rs->sr_ref = is_entry_referral( matched )
|
||||
|
|
@ -256,7 +257,6 @@ ldbm_back_modify(
|
|||
: NULL;
|
||||
cache_return_entry_r( &li->li_cache, matched );
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -268,7 +268,7 @@ ldbm_back_modify(
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
|
||||
|
|
@ -276,6 +276,9 @@ ldbm_back_modify(
|
|||
send_ldap_result( op, rs );
|
||||
|
||||
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
|
||||
rs->sr_ref = NULL;
|
||||
|
|
|
|||
|
|
@ -77,6 +77,7 @@ ldbm_back_modrdn(
|
|||
/* get entry with writer lock */
|
||||
/* FIXME: dn2entry() should return non-glue entry */
|
||||
if (( e == NULL ) || ( !manageDSAit && e && is_entry_glue( e ))) {
|
||||
BerVarray deref = NULL;
|
||||
if ( matched != NULL ) {
|
||||
rs->sr_matched = strdup( matched->e_dn );
|
||||
rs->sr_ref = is_entry_referral( matched )
|
||||
|
|
@ -84,7 +85,6 @@ ldbm_back_modrdn(
|
|||
: NULL;
|
||||
cache_return_entry_r( &li->li_cache, matched );
|
||||
} else {
|
||||
BerVarray deref = NULL;
|
||||
if ( !LDAP_STAILQ_EMPTY( &op->o_bd->be_syncinfo )) {
|
||||
syncinfo_t *si;
|
||||
LDAP_STAILQ_FOREACH( si, &op->o_bd->be_syncinfo, si_next ) {
|
||||
|
|
@ -96,7 +96,7 @@ ldbm_back_modrdn(
|
|||
deref = default_referral;
|
||||
}
|
||||
rs->sr_ref = referral_rewrite( deref, NULL, &op->o_req_dn,
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
LDAP_SCOPE_DEFAULT );
|
||||
}
|
||||
|
||||
ldap_pvt_thread_rdwr_wunlock(&li->li_giant_rwlock);
|
||||
|
|
@ -105,6 +105,9 @@ ldbm_back_modrdn(
|
|||
send_ldap_result( op, rs );
|
||||
|
||||
if ( rs->sr_ref ) ber_bvarray_free( rs->sr_ref );
|
||||
if ( deref != default_referral ) {
|
||||
ber_bvarray_free( deref );
|
||||
}
|
||||
free( (char *)rs->sr_matched );
|
||||
rs->sr_ref = NULL;
|
||||
rs->sr_matched = NULL;
|
||||
|
|
|
|||
Loading…
Reference in a new issue