mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-06 10:46:21 +08:00
Fixing memory leakage in attribute aliasing
This commit is contained in:
parent
7c91b8a327
commit
d2af85fd08
@ -43,6 +43,10 @@ ava_free(
|
|||||||
AttributeAssertion *ava,
|
AttributeAssertion *ava,
|
||||||
int freeit )
|
int freeit )
|
||||||
{
|
{
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
if ( ava->aa_cf && ava->aa_cf->cf_ca->ca_comp_data.cd_mem_op )
|
||||||
|
nibble_mem_free ( ava->aa_cf->cf_ca->ca_comp_data.cd_mem_op );
|
||||||
|
#endif
|
||||||
op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx );
|
op->o_tmpfree( ava->aa_value.bv_val, op->o_tmpmemctx );
|
||||||
if ( freeit ) op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
|
if ( freeit ) op->o_tmpfree( (char *) ava, op->o_tmpmemctx );
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,11 @@ static int search_aliases(
|
|||||||
Entry *matched, *a;
|
Entry *matched, *a;
|
||||||
EntryInfo *ei;
|
EntryInfo *ei;
|
||||||
struct berval bv_alias = BER_BVC( "alias" );
|
struct berval bv_alias = BER_BVC( "alias" );
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion aa_alias = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion aa_alias = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion aa_alias = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
Filter af;
|
Filter af;
|
||||||
DB_LOCK locka, lockr;
|
DB_LOCK locka, lockr;
|
||||||
int first = 1;
|
int first = 1;
|
||||||
@ -1016,10 +1020,18 @@ static int search_candidates(
|
|||||||
int rc, depth = 1;
|
int rc, depth = 1;
|
||||||
Filter f, rf, xf, nf;
|
Filter f, rf, xf, nf;
|
||||||
ID *stack;
|
ID *stack;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion aa_ref = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion aa_ref = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion aa_ref = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
#ifdef BDB_SUBENTRIES
|
#ifdef BDB_SUBENTRIES
|
||||||
Filter sf;
|
Filter sf;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion aa_subentry = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion aa_subentry = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion aa_subentry = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -47,7 +47,11 @@ do_compare(
|
|||||||
struct berval dn = BER_BVNULL;
|
struct berval dn = BER_BVNULL;
|
||||||
struct berval desc = BER_BVNULL;
|
struct berval desc = BER_BVNULL;
|
||||||
struct berval value = BER_BVNULL;
|
struct berval value = BER_BVNULL;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion ava = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
|
|
||||||
ava.aa_desc = NULL;
|
ava.aa_desc = NULL;
|
||||||
|
|
||||||
|
@ -789,7 +789,11 @@ remove_query_data (
|
|||||||
{
|
{
|
||||||
struct query_info *qi, *qnext;
|
struct query_info *qi, *qnext;
|
||||||
char filter_str[64];
|
char filter_str[64];
|
||||||
AttributeAssertion ava;
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion ava = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
Filter filter = {LDAP_FILTER_EQUALITY};
|
Filter filter = {LDAP_FILTER_EQUALITY};
|
||||||
SlapReply sreply = {REP_RESULT};
|
SlapReply sreply = {REP_RESULT};
|
||||||
slap_callback cb = { NULL, remove_func, NULL, NULL };
|
slap_callback cb = { NULL, remove_func, NULL, NULL };
|
||||||
|
@ -604,7 +604,11 @@ syncprov_findcsn( Operation *op, int mode )
|
|||||||
char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
|
char cbuf[LDAP_LUTIL_CSNSTR_BUFSIZE];
|
||||||
struct berval fbuf, maxcsn;
|
struct berval fbuf, maxcsn;
|
||||||
Filter cf, af;
|
Filter cf, af;
|
||||||
AttributeAssertion eq;
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion eq = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
int i, rc = LDAP_SUCCESS;
|
int i, rc = LDAP_SUCCESS;
|
||||||
fpres_cookie pcookie;
|
fpres_cookie pcookie;
|
||||||
sync_control *srs = NULL;
|
sync_control *srs = NULL;
|
||||||
@ -1241,7 +1245,11 @@ syncprov_playlog( Operation *op, SlapReply *rs, sessionlog *sl,
|
|||||||
SlapReply frs = { REP_RESULT };
|
SlapReply frs = { REP_RESULT };
|
||||||
int rc;
|
int rc;
|
||||||
Filter mf, af;
|
Filter mf, af;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
AttributeAssertion eq;
|
AttributeAssertion eq;
|
||||||
|
#endif
|
||||||
slap_callback cb = {0};
|
slap_callback cb = {0};
|
||||||
|
|
||||||
fop = *op;
|
fop = *op;
|
||||||
@ -1868,6 +1876,9 @@ shortcut:
|
|||||||
fava->f_choice = LDAP_FILTER_LE;
|
fava->f_choice = LDAP_FILTER_LE;
|
||||||
fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
|
fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
|
||||||
fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
|
fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
fava->f_ava->aa_cf = NULL;
|
||||||
|
#endif
|
||||||
ber_dupbv_x( &fava->f_ava->aa_value, &ctxcsn, op->o_tmpmemctx );
|
ber_dupbv_x( &fava->f_ava->aa_value, &ctxcsn, op->o_tmpmemctx );
|
||||||
fand->f_and = fava;
|
fand->f_and = fava;
|
||||||
if ( gotstate ) {
|
if ( gotstate ) {
|
||||||
@ -1876,6 +1887,9 @@ shortcut:
|
|||||||
fava->f_choice = LDAP_FILTER_GE;
|
fava->f_choice = LDAP_FILTER_GE;
|
||||||
fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
|
fava->f_ava = op->o_tmpalloc( sizeof(AttributeAssertion), op->o_tmpmemctx );
|
||||||
fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
|
fava->f_ava->aa_desc = slap_schema.si_ad_entryCSN;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
|
fava->f_ava->aa_cf = NULL;
|
||||||
|
#endif
|
||||||
ber_dupbv_x( &fava->f_ava->aa_value, &srs->sr_state.ctxcsn, op->o_tmpmemctx );
|
ber_dupbv_x( &fava->f_ava->aa_value, &srs->sr_state.ctxcsn, op->o_tmpmemctx );
|
||||||
}
|
}
|
||||||
fava->f_next = op->ors_filter;
|
fava->f_next = op->ors_filter;
|
||||||
|
@ -1153,7 +1153,11 @@ syncrepl_entry(
|
|||||||
SlapReply rs_add = {REP_RESULT};
|
SlapReply rs_add = {REP_RESULT};
|
||||||
SlapReply rs_modify = {REP_RESULT};
|
SlapReply rs_modify = {REP_RESULT};
|
||||||
Filter f = {0};
|
Filter f = {0};
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion ava = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion ava = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
int rc = LDAP_SUCCESS;
|
int rc = LDAP_SUCCESS;
|
||||||
int ret = LDAP_SUCCESS;
|
int ret = LDAP_SUCCESS;
|
||||||
|
|
||||||
@ -1548,7 +1552,11 @@ syncrepl_del_nonpresent(
|
|||||||
|
|
||||||
if ( uuids ) {
|
if ( uuids ) {
|
||||||
Filter uf;
|
Filter uf;
|
||||||
|
#ifdef LDAP_COMP_MATCH
|
||||||
AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
|
AttributeAssertion eq = { NULL, BER_BVNULL, NULL };
|
||||||
|
#else
|
||||||
|
AttributeAssertion eq = { NULL, BER_BVNULL };
|
||||||
|
#endif
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
op->ors_attrsonly = 1;
|
op->ors_attrsonly = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user