*/
/* get the name */
- if ( ber_scanf( ber, "{o", /*}*/ &dn ) == LBER_ERROR ) {
+ if ( ber_scanf( ber, "{m", /*}*/ &dn ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_add: conn %d ber_scanf failed\n", conn->c_connid ));
{
Modifications *mod;
- rc = ber_scanf( ber, "{o{W}}", &tmp.sml_type, &tmp.sml_bvalues );
+ rc = ber_scanf( ber, "{m{W}}", &tmp.sml_type, &tmp.sml_bvalues );
if ( rc == LBER_ERROR ) {
#ifdef NEW_LOGGING
}
done:
- free( dn.bv_val );
-
if( modlist != NULL ) {
slap_mods_free( modlist );
}
struct berval type, value;
AttributeAssertion *aa;
- rc = ber_scanf( ber, "{oo}", &type, &value );
+ rc = ber_scanf( ber, "{mm}", &type, &value );
if( rc == LBER_ERROR ) {
#ifdef NEW_LOGGING
aa->aa_value.bv_val = NULL;
rc = slap_bv2ad( &type, &aa->aa_desc, text );
- ch_free( type.bv_val );
if( rc != LDAP_SUCCESS ) {
- ch_free( value.bv_val );
ch_free( aa );
return rc;
}
rc = value_normalize( aa->aa_desc, usage, &value, &aa->aa_value, text );
- ch_free( value.bv_val );
if( rc != LDAP_SUCCESS ) {
ch_free( aa );
bdb_entry_return( be, e );
}
- if( id.bv_val != NULL ) {
- free( id.bv_val );
- }
-
- if( new.bv_val != NULL ) {
- free( new.bv_val );
- }
-
if( hash.bv_val != NULL ) {
free( hash.bv_val );
}
struct berval *bv, bdn;
const char *text;
- if ( ber_scanf( &ber, "{o{", &bdn ) == LBER_ERROR ) {
+ if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
return;
}
#ifdef ENABLE_REWRITE
case REWRITE_REGEXEC_OK:
if ( ent.e_name.bv_val == NULL ) {
ent.e_name = bdn;
-
} else {
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_DETAIL1,
Debug( LDAP_DEBUG_ARGS, "rw> searchResult: \"%s\""
" -> \"%s\"\n%s", bdn.bv_val, ent.e_dn, "" );
#endif /* !NEW_LOGGING */
- free( bdn.bv_val );
- bdn.bv_val = NULL;
ent.e_name.bv_len = strlen( ent.e_name.bv_val );
}
break;
ent.e_private = 0;
attrp = &ent.e_attrs;
- while ( ber_scanf( &ber, "{o", &a ) != LBER_ERROR ) {
+ while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
ldap_back_map(&li->at_map, &a, &mapped, 1);
- if ( mapped.bv_val != a.bv_val) {
- free( a.bv_val );
- }
if (mapped.bv_val == NULL)
continue;
attr = (Attribute *)ch_malloc( sizeof(Attribute) );
attr->a_vals[last].bv_val = NULL;
i--;
} else if ( mapped.bv_val != bv->bv_val ) {
- ch_free(bv->bv_val);
+ free(bv->bv_val);
ber_dupbv( bv, &mapped );
}
}
attr->a_desc->ad_type->sat_cname.bv_val,
bv->bv_val, newval );
#endif /* !NEW_LOGGING */
-
free( bv->bv_val );
bv->bv_val = newval;
bv->bv_len = strlen( newval );
free(attr);
}
- if ( ent.e_dn )
+ if ( ent.e_dn && ent.e_dn != bdn.bv_val )
free( ent.e_dn );
if ( ent.e_ndn )
free( ent.e_ndn );
}
-
cache_return_entry_w( &li->li_cache, e );
}
- if( id.bv_val != NULL ) {
- free( id.bv_val );
- }
-
- if( new.bv_val != NULL ) {
- free( new.bv_val );
- }
-
if( hash.bv_val != NULL ) {
free( hash.bv_val );
}
struct berval *bv, bdn;
const char *text;
- if ( ber_scanf( &ber, "{o{", &bdn ) == LBER_ERROR ) {
+ if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
return;
}
Debug( LDAP_DEBUG_ARGS, "rw> searchResult[%d]: \"%s\""
" -> \"%s\"\n", target, bdn.bv_val, ent.e_name.bv_val );
#endif /* !NEW_LOGGING */
- free( bdn.bv_val );
- bdn.bv_val = NULL;
ent.e_name.bv_len = strlen( ent.e_name.bv_val );
}
break;
ent.e_private = 0;
attrp = &ent.e_attrs;
- while ( ber_scanf( &ber, "{o", &a ) != LBER_ERROR ) {
+ while ( ber_scanf( &ber, "{m", &a ) != LBER_ERROR ) {
ldap_back_map( &li->targets[ target ]->at_map,
&a, &mapped, 1 );
- if ( mapped.bv_val != a.bv_val ) {
- free( a.bv_val );
- }
if ( mapped.bv_val == NULL ) {
continue;
}
i--;
} else if ( mapped.bv_val != bv->bv_val ) {
- ch_free( bv->bv_val );
+ free( bv->bv_val );
ber_dupbv( bv, &mapped );
}
}
attr->a_desc->ad_type->sat_cname.bv_val,
bv->bv_val, newval );
#endif /* !NEW_LOGGING */
-
free( bv->bv_val );
bv->bv_val = newval;
bv->bv_len = strlen( newval );
free( attr );
}
- if ( ent.e_dn ) {
+ if ( ent.e_dn && ent.e_dn != bdn.bv_val ) {
free( ent.e_dn );
}
if ( ent.e_ndn ) {
* }
*/
- tag = ber_scanf( ber, "{iot" /*}*/, &version, &dn, &method );
+ tag = ber_scanf( ber, "{imt" /*}*/, &version, &dn, &method );
if ( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
op->o_protocol = version;
if( method != LDAP_AUTH_SASL ) {
- tag = ber_scanf( ber, /*{*/ "o}", &cred );
+ tag = ber_scanf( ber, /*{*/ "m}", &cred );
} else {
tag = ber_scanf( ber, "{a" /*}*/, &mech );
tag = ber_peek_tag( ber, &len );
if ( tag == LDAP_TAG_LDAPCRED ) {
- tag = ber_scanf( ber, "o", &cred );
+ tag = ber_scanf( ber, "m", &cred );
} else {
tag = LDAP_TAG_LDAPCRED;
cred.bv_val = NULL;
goto cleanup;
}
- if( mech == NULL || *mech == '\0' ) {
+ if( mech == NULL || mech[0] == '\0' ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_INFO,
"do_bind: conn %d no SASL mechanism provided\n",
}
cleanup:
- free( dn.bv_val );
if( pdn.bv_val != NULL ) {
free( pdn.bv_val );
}
if ( mech != NULL ) {
free( mech );
}
- if ( cred.bv_val != NULL ) {
- free( cred.bv_val );
- }
return rc;
}
struct berval ndn = { 0, NULL };
struct berval desc = { 0, NULL };
struct berval value = { 0, NULL };
- AttributeAssertion ava;
+ AttributeAssertion ava = { 0 };
Backend *be;
int rc = LDAP_SUCCESS;
const char *text = NULL;
* }
*/
- if ( ber_scanf( op->o_ber, "{o" /*}*/, &dn ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_compare: conn %d ber_scanf failed\n", conn->c_connid ));
return SLAPD_DISCONNECT;
}
- if ( ber_scanf( op->o_ber, "{oo}", &desc, &value ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{mm}", &desc, &value ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_compare: conn %d get ava failed\n", conn->c_connid ));
}
cleanup:
- free( dn.bv_val );
free( pdn.bv_val );
free( ndn.bv_val );
- free( desc.bv_val );
- free( value.bv_val );
+ if ( ava.aa_value.bv_val ) free( ava.aa_value.bv_val );
return rc;
}
* DelRequest := DistinguishedName
*/
- if ( ber_scanf( op->o_ber, "o", &dn ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "m", &dn ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_delete: conn: %d ber_scanf failed\n", conn->c_connid ));
}
cleanup:
- free( dn.bv_val );
free( pdn.bv_val );
free( ndn.bv_val );
return rc;
#else
Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 );
#endif
- if ( ber_scanf( ber, "o", &type ) == LBER_ERROR ) {
+ if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) {
err = SLAPD_DISCONNECT;
*text = "error decoding filter";
break;
f->f_result = LDAP_COMPARE_FALSE;
ber_str2bv("(unrecognized=*)",
sizeof("(unrecognized=*)")-1, 1, fstr);
- ch_free( type.bv_val );
err = LDAP_SUCCESS;
break;
}
- ch_free( type.bv_val );
-
fstr->bv_len = sizeof("(=*)") - 1
+ f->f_desc->ad_cname.bv_len;
fstr->bv_val = ch_malloc( fstr->bv_len + 1);
#else
Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );
#endif
- if ( ber_scanf( ber, "{o" /*}*/, &bv ) == LBER_ERROR ) {
+ if ( ber_scanf( ber, "{m" /*}*/, &bv ) == LBER_ERROR ) {
return SLAPD_DISCONNECT;
}
f->f_sub_desc = NULL;
rc = slap_bv2ad( &bv, &f->f_sub_desc, text );
- ch_free( bv.bv_val );
-
if( rc != LDAP_SUCCESS ) {
text = NULL;
ch_free( f->f_sub );
{
unsigned usage;
- rc = ber_scanf( ber, "o", &value );
+ rc = ber_scanf( ber, "m", &value );
if ( rc == LBER_ERROR ) {
rc = SLAPD_DISCONNECT;
goto return_error;
" unknown substring choice=%ld\n",
(long) tag, 0, 0 );
#endif
- free( value.bv_val );
goto return_error;
}
rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text );
- free( value.bv_val );
if( rc != LDAP_SUCCESS ) {
goto return_error;
* }
*/
- if ( ber_scanf( op->o_ber, "{o" /*}*/, &dn ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{m" /*}*/, &dn ) == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
"do_modify: ber_scanf failed\n" ));
Modifications tmp, *mod;
- if ( ber_scanf( op->o_ber, "{i{o[W]}}", &mop,
+ if ( ber_scanf( op->o_ber, "{i{m[W]}}", &mop,
&tmp.sml_type, &tmp.sml_bvalues )
== LBER_ERROR )
{
}
cleanup:
- free( dn.bv_val );
free( pdn.bv_val );
free( ndn.bv_val );
if ( modlist != NULL )
* }
*/
- if ( ber_scanf( op->o_ber, "{oob", &dn, &newrdn, &deloldrdn )
+ if ( ber_scanf( op->o_ber, "{mmb", &dn, &newrdn, &deloldrdn )
== LBER_ERROR )
{
#ifdef NEW_LOGGING
goto cleanup;
}
- if ( ber_scanf( op->o_ber, "o", &newSuperior )
+ if ( ber_scanf( op->o_ber, "m", &newSuperior )
== LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
- "do_modrdn: ber_scanf(\"a\") failed\n" ));
+ "do_modrdn: ber_scanf(\"m\") failed\n" ));
#else
- Debug( LDAP_DEBUG_ANY, "ber_scanf(\"a\") failed\n",
+ Debug( LDAP_DEBUG_ANY, "ber_scanf(\"m\") failed\n",
0, 0, 0 );
#endif
}
cleanup:
- free( dn.bv_val );
free( pdn.bv_val );
free( ndn.bv_val );
- free( newrdn.bv_val );
free( pnewrdn.bv_val );
free( nnewrdn.bv_val );
- if ( newSuperior.bv_val ) free( newSuperior.bv_val );
if ( pnewSuperior.bv_val ) free( pnewSuperior.bv_val );
if ( nnewSuperior.bv_val ) free( nnewSuperior.bv_val );
int freeit
)
{
+#if 0
if ( mod->sm_type.bv_val)
free( mod->sm_type.bv_val );
+#endif
if ( mod->sm_bvalues != NULL )
bvarray_free( mod->sm_bvalues );
}
if ( tag == LDAP_FILTER_EXT_TYPE ) {
- rc = ber_scanf( ber, "o", &type );
+ rc = ber_scanf( ber, "m", &type );
if ( rc == LBER_ERROR ) {
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_ERR,
}
rc = slap_bv2ad( &type, &ma->ma_desc, text );
- ch_free( type.bv_val );
if( rc != LDAP_SUCCESS ) {
mra_free( ma, 1 );
return SLAPD_DISCONNECT;
}
- rc = ber_scanf( ber, "o", &value );
+ rc = ber_scanf( ber, "m", &value );
if( rc == LBER_ERROR ) {
#ifdef NEW_LOGGING
* normalize for the matching rule.
*/
rc = value_normalize( ma->ma_desc, SLAP_MR_EQUALITY, &value, &ma->ma_value, text );
- ch_free( value.bv_val );
if( rc != LDAP_SUCCESS ) {
mra_free( ma, 1 );
goto done;
}
- tag = ber_scanf( ber, "o", id );
+ tag = ber_scanf( ber, "m", id );
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
goto done;
}
- tag = ber_scanf( ber, "o", oldpass );
+ tag = ber_scanf( ber, "m", oldpass );
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
goto done;
}
- tag = ber_scanf( ber, "o", newpass );
+ tag = ber_scanf( ber, "m", newpass );
if( tag == LBER_ERROR ) {
#ifdef NEW_LOGGING
*/
/* baseObject, scope, derefAliases, sizelimit, timelimit, attrsOnly */
- if ( ber_scanf( op->o_ber, "{oiiiib" /*}*/,
+ if ( ber_scanf( op->o_ber, "{miiiib" /*}*/,
&base, &scope, &deref, &sizelimit,
&timelimit, &attrsonly ) == LBER_ERROR )
{
/* attributes */
siz = sizeof(AttributeName);
off = 0;
- if ( ber_scanf( op->o_ber, "{w}}", &an, &siz, off ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{M}}", &an, &siz, off ) == LBER_ERROR ) {
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding attrs error" );
rc = SLAPD_DISCONNECT;
}
return_results:;
- free( base.bv_val );
if( pbase.bv_val != NULL) free( pbase.bv_val );
if( nbase.bv_val != NULL) free( nbase.bv_val );
if( fstr.bv_val != NULL) free( fstr.bv_val );
if( filter != NULL) filter_free( filter );
- for (i = 0; i<siz; i++ ) {
- free(an[i].an_name.bv_val);
- }
free(an);
return rc;