Cleanup NULL derefs

This commit is contained in:
Howard Chu 2006-03-31 21:18:04 +00:00
parent aa87b9ad2e
commit 2d4da0b23c
3 changed files with 13 additions and 10 deletions

View File

@ -65,8 +65,9 @@ ldap_create_page_control_value(
if ( ld == NULL || value == NULL ||
pagesize < 1 || pagesize > LDAP_MAXINT )
{
if ( ld )
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
return LDAP_PARAM_ERROR;
}
assert( LDAP_VALID( ld ) );
@ -195,8 +196,9 @@ ldap_parse_pageresponse_control(
ber_int_t count;
if ( ld == NULL || ctrl == NULL || cookie == NULL ) {
if ( ld )
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
return LDAP_PARAM_ERROR;
}
/* Create a BerElement from the berval returned in the control. */

View File

@ -297,8 +297,9 @@ ldap_create_sort_control_value(
ber_tag_t tag;
if ( ld == NULL || keyList == NULL || value == NULL ) {
if ( ld )
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
return LDAP_PARAM_ERROR;
}
assert( LDAP_VALID( ld ) );
@ -496,8 +497,7 @@ ldap_parse_sortresponse_control(
ber_len_t berLen;
if (ld == NULL) {
ld->ld_errno = LDAP_PARAM_ERROR;
return(ld->ld_errno);
return LDAP_PARAM_ERROR;
}
if (ctrl == NULL) {

View File

@ -95,8 +95,9 @@ ldap_create_vlv_control_value(
BerElement *ber;
if ( ld == NULL || vlvinfop == NULL || value == NULL ) {
if ( ld )
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
return LDAP_PARAM_ERROR;
}
assert( LDAP_VALID( ld ) );