From: Kurt Zeilenga Date: Tue, 4 Jul 2000 21:59:41 +0000 (+0000) Subject: Correct improper ldap_result() result checking... X-Git-Tag: LDBM_PRE_GIANT_RWLOCK~2480 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f6cda93bd1288a5c3ded4b963c7e70d83cb63f3a;p=openldap Correct improper ldap_result() result checking... --- diff --git a/clients/tools/ldapdelete.c b/clients/tools/ldapdelete.c index 4b068df7f5..200d9f2a21 100644 --- a/clients/tools/ldapdelete.c +++ b/clients/tools/ldapdelete.c @@ -462,9 +462,8 @@ static int dodelete( } rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res ); - if ( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapdelete: ldap_result: %s (%d)\n", - ldap_err2string( rc ), rc ); + if ( rc < 0 ) { + ldap_perror( ld, "ldapdelete: ldap_result" ); return rc; } diff --git a/clients/tools/ldapmodrdn.c b/clients/tools/ldapmodrdn.c index 9905d0f2c6..142efb62dc 100644 --- a/clients/tools/ldapmodrdn.c +++ b/clients/tools/ldapmodrdn.c @@ -515,9 +515,8 @@ static int domodrdn( } rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res ); - if ( rc != LDAP_SUCCESS ) { - fprintf( stderr, "ldapmodrdn: ldap_result: %s (%d)\n", - ldap_err2string( rc ), rc ); + if ( rc < 0 ) { + ldap_perror( ld, "ldapmodrdn: ldap_result" ); return rc; } diff --git a/clients/tools/ldappasswd.c b/clients/tools/ldappasswd.c index c61c6e5eec..5385aa1d58 100644 --- a/clients/tools/ldappasswd.c +++ b/clients/tools/ldappasswd.c @@ -450,8 +450,8 @@ main( int argc, char *argv[] ) } rc = ldap_result( ld, LDAP_RES_ANY, LDAP_MSG_ALL, NULL, &res ); - if ( rc != LDAP_SUCCESS ) { - ldap_perror( ld, "ldap_result" ); + if ( rc < 0 ) { + ldap_perror( ld, "ldappasswd: ldap_result" ); return rc; } @@ -514,7 +514,7 @@ main( int argc, char *argv[] ) ber_memfree( text ); ber_memfree( matcheddn ); - ber_memvfree( refs ); + ber_memvfree( (void **) refs ); ber_memfree( retoid ); ber_bvfree( retdata );