mirror of
https://git.openldap.org/openldap/openldap.git
synced 2026-01-03 13:40:37 -05:00
ITS#4679 cleanup
Note: the caller is expected to pass in a valid LDAP handle. If not, the assert will trigger to let him know his code is broken.
This commit is contained in:
parent
a8e58e3eb4
commit
62f4745bfc
1 changed files with 13 additions and 5 deletions
|
|
@ -296,14 +296,15 @@ ldap_create_sort_control_value(
|
|||
BerElement *ber = NULL;
|
||||
ber_tag_t tag;
|
||||
|
||||
if ( ld == NULL || keyList == NULL || value == NULL ) {
|
||||
if ( ld )
|
||||
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||
assert( ld != NULL );
|
||||
assert( LDAP_VALID( ld ) );
|
||||
|
||||
if ( ld == NULL ) return LDAP_PARAM_ERROR;
|
||||
if ( keyList == NULL || value == NULL ) {
|
||||
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||
return LDAP_PARAM_ERROR;
|
||||
}
|
||||
|
||||
assert( LDAP_VALID( ld ) );
|
||||
|
||||
value->bv_val = NULL;
|
||||
value->bv_len = 0;
|
||||
|
||||
|
|
@ -412,6 +413,10 @@ ldap_create_sort_control(
|
|||
struct berval value;
|
||||
BerElement *ber;
|
||||
|
||||
assert( ld != NULL );
|
||||
assert( LDAP_VALID( ld ) );
|
||||
|
||||
if ( ld == NULL ) return LDAP_PARAM_ERROR;
|
||||
if ( ctrlp == NULL ) {
|
||||
ld->ld_errno = LDAP_PARAM_ERROR;
|
||||
return ld->ld_errno;
|
||||
|
|
@ -496,6 +501,9 @@ ldap_parse_sortresponse_control(
|
|||
ber_tag_t tag, berTag;
|
||||
ber_len_t berLen;
|
||||
|
||||
assert( ld != NULL );
|
||||
assert( LDAP_VALID( ld ) );
|
||||
|
||||
if (ld == NULL) {
|
||||
return LDAP_PARAM_ERROR;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue