Hans Leidekker : wininet: Stop leaking username and password.

Alexandre Julliard julliard at winehq.org
Wed Dec 3 05:56:20 CST 2008


Module: wine
Branch: master
Commit: 2ac52b0eeeed4d193c0262e1c59cfa822dce2fa6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=2ac52b0eeeed4d193c0262e1c59cfa822dce2fa6

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Tue Dec  2 17:15:16 2008 +0100

wininet: Stop leaking username and password.

---

 dlls/wininet/http.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/dlls/wininet/http.c b/dlls/wininet/http.c
index f9b0e5c..fad2e41 100644
--- a/dlls/wininet/http.c
+++ b/dlls/wininet/http.c
@@ -3518,12 +3518,14 @@ static DWORD HTTPSESSION_SetOption(WININETHANDLEHEADER *hdr, DWORD option, void
     switch(option) {
     case INTERNET_OPTION_USERNAME:
     {
-        if (!(ses->lpszUserName = WININET_strdupW(buffer))) break;
+        HeapFree(GetProcessHeap(), 0, ses->lpszUserName);
+        if (!(ses->lpszUserName = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY;
         return ERROR_SUCCESS;
     }
     case INTERNET_OPTION_PASSWORD:
     {
-        if (!(ses->lpszPassword = WININET_strdupW(buffer))) break;
+        HeapFree(GetProcessHeap(), 0, ses->lpszPassword);
+        if (!(ses->lpszPassword = WININET_strdupW(buffer))) return ERROR_OUTOFMEMORY;
         return ERROR_SUCCESS;
     }
     default: break;




More information about the wine-cvs mailing list