From 5d956ebbb1fc0cc84567d13512b233259d51e7e8 Mon Sep 17 00:00:00 2001 From: Martin Fleisz Date: Mon, 21 Mar 2016 16:58:09 +0100 Subject: [PATCH] core: correctly set last error on credssp errors --- libfreerdp/core/nla.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/libfreerdp/core/nla.c b/libfreerdp/core/nla.c index 4a9ed61..457326d 100644 --- a/libfreerdp/core/nla.c +++ b/libfreerdp/core/nla.c @@ -572,12 +572,6 @@ int nla_client_authenticate(rdpNla* nla) if (status < 0) { - if (nla->errorCode) - { - WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: %08X", nla->errorCode); - freerdp_set_last_error(nla->instance->context, nla->errorCode); - } - Stream_Free(s, TRUE); return -1; } @@ -1564,6 +1558,13 @@ int nla_recv_pdu(rdpNla* nla, wStream* s) if (nla_decode_ts_request(nla, s) < 1) return -1; + if (nla->errorCode) + { + WLog_ERR(TAG, "SPNEGO failed with NTSTATUS: %08X", nla->errorCode); + freerdp_set_last_error(nla->instance->context, nla->errorCode); + return -1; + } + if (nla_client_recv(nla) < 1) return -1; -- 2.7.4