diff --git a/winpr/libwinpr/error/error.c b/winpr/libwinpr/error/error.c index 65dc65f51..7d3c0e795 100644 --- a/winpr/libwinpr/error/error.c +++ b/winpr/libwinpr/error/error.c @@ -44,7 +44,7 @@ DWORD GetLastError(VOID) PTEB pt = NtCurrentTeb(); if (pt) { - return NtCurrentTeb()->LastErrorValue; + return pt->LastErrorValue; } return ERROR_OUTOFMEMORY; }