]> git.sur5r.net Git - openldap/blobdiff - clients/tools/common.c
ITS#7695 Fix ldapsearch regression with CLDAP
[openldap] / clients / tools / common.c
index 7d1f15ea0b16fde0d0c78a9304a4cd3054a8bca9..9ae6f28db015e4a3269d9fae232c7db66330cafe 100644 (file)
@@ -1620,11 +1620,13 @@ tool_bind( LDAP *ld )
                }
        }
 
-       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