Commit 2ac52b0e authored by Hans Leidekker's avatar Hans Leidekker Committed by Alexandre Julliard

wininet: Stop leaking username and password.

parent a57cc6dc
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment