diff --git a/clients/tools/common.c b/clients/tools/common.c
index 9b17ad6a710a5bb1c366cb95ee9e8731ad5eb315..9bd97730d947ebe307964468de971f7e2d12a6aa 100644
--- a/clients/tools/common.c
+++ b/clients/tools/common.c
@@ -1521,11 +1521,13 @@ tool_bind( LDAP *ld )
 			tool_exit( ld, LDAP_LOCAL_ERROR );
 		}
 
-		rc = ldap_parse_result( ld, result, &err, &matched, &info, &refs,
-			&ctrls, 1 );
-		if ( rc != LDAP_SUCCESS ) {
-			tool_perror( "ldap_bind parse result", rc, NULL, matched, info, refs );
-			tool_exit( ld, LDAP_LOCAL_ERROR );
+		if ( result ) {
+			rc = ldap_parse_result( ld, result, &err, &matched, &info, &refs,
+			                        &ctrls, 1 );
+			if ( rc != LDAP_SUCCESS ) {
+				tool_perror( "ldap_bind parse result", rc, NULL, matched, info, refs );
+				tool_exit( ld, LDAP_LOCAL_ERROR );
+			}
 		}
 
 #ifdef LDAP_CONTROL_PASSWORDPOLICYREQUEST