#define LBER_ERROR_PARAM 0x1
#define LBER_ERROR_MEMORY 0x2
-#ifdef LDAP_DEVEL
-#define LDAP_NULL_IS_NULL
-#endif
-
LDAP_END_DECL
#endif /* _LBER_H */
return tag;
}
-#ifdef LDAP_NULL_IS_NULL
ber_tag_t
ber_get_stringbv_null( BerElement *ber, struct berval *bv, int alloc )
{
return tag;
}
-#endif /* LDAP_NULL_IS_NULL */
ber_tag_t
ber_get_stringa( BerElement *ber, char **buf )
return tag;
}
-#ifdef LDAP_NULL_IS_NULL
ber_tag_t
ber_get_stringa_null( BerElement *ber, char **buf )
{
return tag;
}
-#endif /* LDAP_NULL_IS_NULL */
ber_tag_t
ber_get_stringal( BerElement *ber, struct berval **bv )
rc = ber_get_stringa( ber, ss );
break;
-#ifdef LDAP_NULL_IS_NULL
case 'A': /* octet string - allocate storage as needed,
* but return NULL if len == 0 */
ss = va_arg( ap, char ** );
rc = ber_get_stringa_null( ber, ss );
break;
-#endif /* LDAP_NULL_IS_NULL */
case 'b': /* boolean */
i = va_arg( ap, ber_int_t * );
} break;
case 'a': /* octet string - allocate storage as needed */
-#ifdef LDAP_NULL_IS_NULL
case 'A':
-#endif /* LDAP_NULL_IS_NULL */
ss = va_arg( ap, char ** );
if ( *ss ) {
LBER_FREE( *ss );
ber = ber_dup( lm->lm_ber );
if ( ld->ld_version < LDAP_VERSION2 ) {
-#ifdef LDAP_NULL_IS_NULL
tag = ber_scanf( ber, "{iA}",
&ld->ld_errno, &ld->ld_error );
-#else /* ! LDAP_NULL_IS_NULL */
- tag = ber_scanf( ber, "{ia}",
- &ld->ld_errno, &ld->ld_error );
-#endif /* ! LDAP_NULL_IS_NULL */
} else {
ber_len_t len;
-#ifdef LDAP_NULL_IS_NULL
tag = ber_scanf( ber, "{iAA" /*}*/,
&ld->ld_errno, &ld->ld_matched, &ld->ld_error );
-#else /* ! LDAP_NULL_IS_NULL */
- tag = ber_scanf( ber, "{iaa" /*}*/,
- &ld->ld_errno, &ld->ld_matched, &ld->ld_error );
-#endif /* ! LDAP_NULL_IS_NULL */
if( tag != LBER_ERROR ) {
/* peek for referrals */
}
if ( errcode == LDAP_SUCCESS ) {
if( matcheddnp != NULL ) {
-#ifdef LDAP_NULL_IS_NULL
if ( ld->ld_matched )
-#endif /* LDAP_NULL_IS_NULL */
{
*matcheddnp = LDAP_STRDUP( ld->ld_matched );
}
}
if( errmsgp != NULL ) {
-#ifdef LDAP_NULL_IS_NULL
if ( ld->ld_error )
-#endif /* LDAP_NULL_IS_NULL */
{
*errmsgp = LDAP_STRDUP( ld->ld_error );
}
return ld->ld_errno;
}
-#ifdef LDAP_NULL_IS_NULL
rc = ber_scanf( ber, "{eAA" /*}*/, &errcode,
&ld->ld_matched, &ld->ld_error );
-#else /* ! LDAP_NULL_IS_NULL */
- rc = ber_scanf( ber, "{eaa" /*}*/, &errcode,
- &ld->ld_matched, &ld->ld_error );
-#endif /* ! LDAP_NULL_IS_NULL */
if( rc == LBER_ERROR ) {
ld->ld_errno = LDAP_DECODING_ERROR;
return ld->ld_errno;
}
-#ifdef LDAP_NULL_IS_NULL
assert( resoid[ 0 ] != '\0' );
-#endif /* LDAP_NULL_IS_NULL */
tag = ber_peek_tag( ber, &len );
}
return ld->ld_errno;
}
-#ifdef LDAP_NULL_IS_NULL
assert( resoid[ 0 ] != '\0' );
-#endif /* LDAP_NULL_IS_NULL */
tag = ber_peek_tag( ber, &len );
}
ber_len_t len;
char *lr_res_error = NULL;
-#ifdef LDAP_NULL_IS_NULL
if ( ber_scanf( &tmpber, "{eAA",/*}*/ &lderr,
&lr->lr_res_matched, &lr_res_error )
!= LBER_ERROR )
-#else /* ! LDAP_NULL_IS_NULL */
- if ( ber_scanf( &tmpber, "{eaa",/*}*/ &lderr,
- &lr->lr_res_matched, &lr_res_error )
- != LBER_ERROR )
-#endif /* ! LDAP_NULL_IS_NULL */
{
if ( lr_res_error != NULL ) {
-#ifndef LDAP_NULL_IS_NULL
- if ( lr_res_error[ 0 ] == '\0' ) {
- LDAP_FREE( lr_res_error );
- lr_res_error = NULL;
- } else
-#endif /* ! LDAP_NULL_IS_NULL */
{
if ( lr->lr_res_error != NULL ) {
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error );
*/
if ( tag == LDAP_RES_SEARCH_RESULT )
refer_cnt = 0;
-#ifdef LDAP_NULL_IS_NULL
} else if ( ber_scanf( &tmpber, "{eAA}", &lderr,
&lr->lr_res_matched, &lr_res_error )
!= LBER_ERROR )
-#else /* ! LDAP_NULL_IS_NULL */
- } else if ( ber_scanf( &tmpber, "{eaa}", &lderr,
- &lr->lr_res_matched, &lr_res_error )
- != LBER_ERROR )
-#endif /* ! LDAP_NULL_IS_NULL */
{
if ( lr_res_error != NULL ) {
-#ifndef LDAP_NULL_IS_NULL
- if ( lr_res_error[ 0 ] == '\0' ) {
- LDAP_FREE( lr_res_error );
- } else
-#endif /* ! LDAP_NULL_IS_NULL */
{
if ( lr->lr_res_error != NULL ) {
(void)ldap_append_referral( ld, &lr->lr_res_error, lr_res_error );
}
if ( ld->ld_version < LDAP_VERSION2 ) {
-#ifdef LDAP_NULL_IS_NULL
tag = ber_scanf( ber, "{iA}",
&errcode, &ld->ld_error );
-#else /* ! LDAP_NULL_IS_NULL */
- tag = ber_scanf( ber, "{ia}",
- &errcode, &ld->ld_error );
-#endif /* ! LDAP_NULL_IS_NULL */
if( tag == LBER_ERROR ) {
ber_free( ber, 0 );
} else {
ber_len_t len;
-#ifdef LDAP_NULL_IS_NULL
tag = ber_scanf( ber, "{eAA" /*}*/,
&errcode, &ld->ld_matched, &ld->ld_error );
-#else /* ! LDAP_NULL_IS_NULL */
- tag = ber_scanf( ber, "{eaa" /*}*/,
- &errcode, &ld->ld_matched, &ld->ld_error );
-#endif /* ! LDAP_NULL_IS_NULL */
if( tag == LBER_ERROR ) {
ber_free( ber, 0 );
default:
rc = ldap_parse_result( lc->lc_ld, res, &rs->sr_err,
&match, &text, NULL, NULL, 1 );
-#ifndef LDAP_NULL_IS_NULL
- if ( match != NULL && match[ 0 ] == '\0' ) {
- ldap_memfree( match );
- match = NULL;
- }
- if ( text != NULL && text[ 0 ] == '\0' ) {
- ldap_memfree( text );
- text = NULL;
- }
-#endif /* LDAP_NULL_IS_NULL */
rs->sr_text = text;
if ( rc != LDAP_SUCCESS ) {
rs->sr_err = rc;
(char **)&rs->sr_matched,
(char **)&rs->sr_text,
NULL, NULL, 0 );
-#ifndef LDAP_NULL_IS_NULL
- if ( rs->sr_matched && rs->sr_matched[ 0 ] == '\0' ) {
- free( (char *)rs->sr_matched );
- rs->sr_matched = NULL;
- }
- if ( rs->sr_text && rs->sr_text[ 0 ] == '\0' ) {
- free( (char *)rs->sr_text );
- rs->sr_text = NULL;
- }
-#endif /* LDAP_NULL_IS_NULL */
if ( rc == LDAP_SUCCESS ) {
if ( rs->sr_err == LDAP_SUCCESS ) {
(char **)&rs->sr_matched,
(char **)&rs->sr_text,
NULL, NULL, 0 );
-#ifndef LDAP_NULL_IS_NULL
- if ( rs->sr_matched && rs->sr_matched[ 0 ] == '\0' ) {
- free( (char *)rs->sr_matched );
- rs->sr_matched = NULL;
- }
- if ( rs->sr_text && rs->sr_text[ 0 ] == '\0' ) {
- free( (char *)rs->sr_text );
- rs->sr_text = NULL;
- }
-#endif /* LDAP_NULL_IS_NULL */
if ( rc == LDAP_SUCCESS ) {
if ( rs->sr_err == LDAP_SUCCESS ) {
rc = ldap_parse_extended_result( lc->lc_ld, res,
}
if ( match.bv_val != NULL ) {
-#ifndef LDAP_NULL_IS_NULL
- if ( match.bv_val[ 0 ] == '\0' ) {
- LDAP_FREE( match.bv_val );
- BER_BVZERO( &match );
- } else
-#endif /* LDAP_NULL_IS_NULL */
{
match.bv_len = strlen( match.bv_val );
}
}
-#ifndef LDAP_NULL_IS_NULL
- if ( rs->sr_text != NULL && rs->sr_text[ 0 ] == '\0' ) {
- LDAP_FREE( (char *)rs->sr_text );
- rs->sr_text = NULL;
- }
-#endif /* LDAP_NULL_IS_NULL */
/* cleanup */
if ( references ) {
/* massage matchedDN if need be */
if ( candidates[ i ].sr_matched != NULL ) {
-#ifndef LDAP_NULL_IS_NULL
- if ( candidates[ i ].sr_matched[ 0 ] == '\0' ) {
- ldap_memfree( (char *)candidates[ i ].sr_matched );
- candidates[ i ].sr_matched = NULL;
-
- } else
-#endif /* LDAP_NULL_IS_NULL */
{
struct berval match, mmatch;
}
}
-#ifndef LDAP_NULL_IS_NULL
- /* just get rid of the error message, if any */
- if ( candidates[ i ].sr_text && candidates[ i ].sr_text[ 0 ] == '\0' )
- {
- ldap_memfree( (char *)candidates[ i ].sr_text );
- candidates[ i ].sr_text = NULL;
- }
-#endif /* LDAP_NULL_IS_NULL */
/* add references to array */
if ( references ) {