[2/2] wininet: Free per-thread error info upon exit from an async procedure.

Hans Leidekker hans at codeweavers.com
Mon Dec 21 04:14:16 CST 2009


Found by Valgrind.
---
 dlls/wininet/internet.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/dlls/wininet/internet.c b/dlls/wininet/internet.c
index d749e53..2b8d767 100644
--- a/dlls/wininet/internet.c
+++ b/dlls/wininet/internet.c
@@ -3127,8 +3127,12 @@ static DWORD CALLBACK INTERNET_WorkerThreadFunc(LPVOID lpvParam)
     HeapFree(GetProcessHeap(), 0, lpRequest);
 
     workRequest.asyncproc(&workRequest);
-
     WININET_Release( workRequest.hdr );
+
+    if (g_dwTlsErrIndex != TLS_OUT_OF_INDEXES)
+    {
+        HeapFree(GetProcessHeap(), 0, TlsGetValue(g_dwTlsErrIndex));
+    }
     return TRUE;
 }
 
-- 
1.6.3.3




More information about the wine-patches mailing list