Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

resolve several issues found by cppcheck #136

Merged
merged 2 commits into from
Aug 14, 2017
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions libraries/libreldap/sortctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,11 @@ ldap_create_sort_control_value(
ber_tag_t tag;

assert( ld != NULL );
assert( LDAP_VALID( ld ) );

if ( ld == NULL ) return LDAP_PARAM_ERROR;

assert( LDAP_VALID( ld ) );
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This assert is useless here.


if ( keyList == NULL || value == NULL ) {
ld->ld_errno = LDAP_PARAM_ERROR;
return LDAP_PARAM_ERROR;
Expand Down Expand Up @@ -396,12 +398,13 @@ ldap_create_sort_control(
struct berval value;

assert( ld != NULL );
assert( LDAP_VALID( ld ) );

if ( ld == NULL ) {
return LDAP_PARAM_ERROR;
}

assert( LDAP_VALID( ld ) );

if ( ctrlp == NULL ) {
ld->ld_errno = LDAP_PARAM_ERROR;
return ld->ld_errno;
Expand Down Expand Up @@ -479,12 +482,13 @@ ldap_parse_sortresponse_control(
ber_len_t berLen;

assert( ld != NULL );
assert( LDAP_VALID( ld ) );

if (ld == NULL) {
return LDAP_PARAM_ERROR;
}

assert( LDAP_VALID( ld ) );

if (ctrl == NULL) {
ld->ld_errno = LDAP_PARAM_ERROR;
return(ld->ld_errno);
Expand Down