mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-23 08:09:34 -05:00
don't care about empty matched/text #ifdef LDAP_NULL_IS_NULL
This commit is contained in:
parent
01bea97a26
commit
4852bf8a58
4 changed files with 28 additions and 2 deletions
|
|
@ -866,6 +866,16 @@ retry:;
|
|||
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;
|
||||
|
|
|
|||
|
|
@ -135,6 +135,7 @@ retry:
|
|||
(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;
|
||||
|
|
@ -143,6 +144,7 @@ retry:
|
|||
free( (char *)rs->sr_text );
|
||||
rs->sr_text = NULL;
|
||||
}
|
||||
#endif /* LDAP_NULL_IS_NULL */
|
||||
if ( rc == LDAP_SUCCESS ) {
|
||||
if ( rs->sr_err == LDAP_SUCCESS ) {
|
||||
struct berval newpw;
|
||||
|
|
|
|||
|
|
@ -402,13 +402,22 @@ retry:
|
|||
}
|
||||
|
||||
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 {
|
||||
} 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 ) {
|
||||
|
|
|
|||
|
|
@ -595,11 +595,14 @@ really_bad:;
|
|||
|
||||
/* 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 {
|
||||
} else
|
||||
#endif /* LDAP_NULL_IS_NULL */
|
||||
{
|
||||
struct berval match, mmatch;
|
||||
|
||||
ber_str2bv( candidates[ i ].sr_matched,
|
||||
|
|
@ -622,12 +625,14 @@ really_bad:;
|
|||
}
|
||||
}
|
||||
|
||||
#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 ) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue