X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fsearch.c;h=7c6f62b977d180d40824f2c2cedb9a0578087c6c;hb=3d39ff68a94e4455074707d763138f01aaa1c5b1;hp=2f27eddd6eff8fce4abd505cc02577e7198f082c;hpb=4e32148ac59ba6b4f3acc79a3b782cd3556f941a;p=openldap diff --git a/libraries/libldap/search.c b/libraries/libldap/search.c index 2f27eddd6e..7c6f62b977 100644 --- a/libraries/libldap/search.c +++ b/libraries/libldap/search.c @@ -358,7 +358,7 @@ ldap_search_st( == -1 ) return( ld->ld_errno ); - if ( ldap_result( ld, msgid, LDAP_MSG_ALL, timeout, res ) == -1 ) + if ( ldap_result( ld, msgid, LDAP_MSG_ALL, timeout, res ) == -1 || !*res ) return( ld->ld_errno ); if ( ld->ld_errno == LDAP_TIMEOUT ) { @@ -386,7 +386,7 @@ ldap_search_s( == -1 ) return( ld->ld_errno ); - if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, res ) == -1 || !res ) + if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, res ) == -1 || !*res ) return( ld->ld_errno ); return( ldap_result2error( ld, *res, 0 ) );