]> git.sur5r.net Git - openldap/commitdiff
Correct improper ldap_result() result checking...
authorKurt Zeilenga <kurt@openldap.org>
Tue, 4 Jul 2000 21:59:41 +0000 (21:59 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Tue, 4 Jul 2000 21:59:41 +0000 (21:59 +0000)
clients/tools/ldapdelete.c
clients/tools/ldapmodrdn.c
clients/tools/ldappasswd.c

index 4b068df7f516d801f6b0472f3894d6d5541cde84..200d9f2a21fc90033c61c781dcfc1c6b112d7381 100644 (file)
@@ -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;
        }
 
index 9905d0f2c6c8f5b9e7fc7ebd561dc32b5f36f2f5..142efb62dcce355aec30748eb494c2e36c317290 100644 (file)
@@ -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;
        }
 
index c61c6e5eec575c51e9fe12c1a1d03c96a2cf9fee..5385aa1d584e8e0ce1006d0bb8330a08ca5b5f0c 100644 (file)
@@ -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 );