core: correctly set last error on credssp errors
authorMartin Fleisz <martin.fleisz@thincast.com>
Mon, 21 Mar 2016 15:58:09 +0000 (16:58 +0100)
committerMartin Fleisz <martin.fleisz@thincast.com>
Mon, 21 Mar 2016 15:58:09 +0000 (16:58 +0100)
libfreerdp/core/nla.c

index 4a9ed61..457326d 100644 (file)
@@ -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;