Hans Leidekker (@hans) commented about dlls/wldap32/init.c:
else { ret = map_error( ldap_start_tls_s( CTX(ld), serverctrlsU, clientctrlsU ) );
if (!ret && !check_certificate( ld ))
ret = WLDAP32_LDAP_LOCAL_ERROR;
If you add a check to all functions that need a connection then it shouldn't be needed here.