Fixed duplicate call to NtCurrentTeb
authorArmin Novak <armin.novak@thincast.com>
Wed, 22 Jan 2020 14:17:03 +0000 (15:17 +0100)
committerakallabeth <akallabeth@users.noreply.github.com>
Tue, 25 May 2021 13:30:50 +0000 (15:30 +0200)
(cherry picked from commit ca1fe0193e2728635b415478dc366939817cfb6c)

winpr/libwinpr/error/error.c

index 65dc65f..7d3c0e7 100644 (file)
@@ -44,7 +44,7 @@ DWORD GetLastError(VOID)
        PTEB pt = NtCurrentTeb();
        if (pt)
        {
-               return NtCurrentTeb()->LastErrorValue;
+               return pt->LastErrorValue;
        }
        return ERROR_OUTOFMEMORY;
 }