Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
d5a98e5d
Commit
d5a98e5d
authored
Sep 05, 2011
by
Hans Leidekker
Committed by
Alexandre Julliard
Sep 05, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: Fix some memory leaks.
parent
3762de9d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
request.c
dlls/winhttp/request.c
+16
-2
session.c
dlls/winhttp/session.c
+6
-5
No files found.
dlls/winhttp/request.c
View file @
d5a98e5d
...
...
@@ -2403,20 +2403,32 @@ static HRESULT WINAPI winhttp_request_SetProxy(
{
case
HTTPREQUEST_PROXYSETTING_DEFAULT
:
request
->
proxy
.
dwAccessType
=
WINHTTP_ACCESS_TYPE_DEFAULT_PROXY
;
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxy
);
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxyBypass
);
request
->
proxy
.
lpszProxy
=
NULL
;
request
->
proxy
.
lpszProxyBypass
=
NULL
;
break
;
case
HTTPREQUEST_PROXYSETTING_DIRECT
:
request
->
proxy
.
dwAccessType
=
WINHTTP_ACCESS_TYPE_NO_PROXY
;
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxy
);
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxyBypass
);
request
->
proxy
.
lpszProxy
=
NULL
;
request
->
proxy
.
lpszProxyBypass
=
NULL
;
break
;
case
HTTPREQUEST_PROXYSETTING_PROXY
:
request
->
proxy
.
dwAccessType
=
WINHTTP_ACCESS_TYPE_NAMED_PROXY
;
if
(
V_VT
(
&
proxy_server
)
==
VT_BSTR
)
request
->
proxy
.
lpszProxy
=
strdupW
(
V_BSTR
(
&
proxy_server
)
);
if
(
V_VT
(
&
bypass_list
)
==
VT_BSTR
)
request
->
proxy
.
lpszProxyBypass
=
strdupW
(
V_BSTR
(
&
bypass_list
)
);
if
(
V_VT
(
&
proxy_server
)
==
VT_BSTR
)
{
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxy
);
request
->
proxy
.
lpszProxy
=
strdupW
(
V_BSTR
(
&
proxy_server
)
);
}
if
(
V_VT
(
&
bypass_list
)
==
VT_BSTR
)
{
heap_free
(
(
WCHAR
*
)
request
->
proxy
.
lpszProxyBypass
);
request
->
proxy
.
lpszProxyBypass
=
strdupW
(
V_BSTR
(
&
bypass_list
)
);
}
break
;
default:
...
...
@@ -3334,6 +3346,8 @@ HRESULT WinHttpRequest_create( IUnknown *unknown, void **obj )
request
->
IWinHttpRequest_iface
.
lpVtbl
=
&
winhttp_request_vtbl
;
request
->
refs
=
1
;
request
->
state
=
REQUEST_STATE_UNINITIALIZED
;
request
->
proxy
.
lpszProxy
=
NULL
;
request
->
proxy
.
lpszProxyBypass
=
NULL
;
InitializeCriticalSection
(
&
request
->
cs
);
*
obj
=
&
request
->
IWinHttpRequest_iface
;
...
...
dlls/winhttp/session.c
View file @
d5a98e5d
...
...
@@ -206,6 +206,7 @@ HINTERNET WINAPI WinHttpOpen( LPCWSTR agent, DWORD access, LPCWSTR proxy, LPCWST
session
->
hdr
.
flags
=
flags
;
session
->
hdr
.
refs
=
1
;
session
->
hdr
.
redirect_policy
=
WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP
;
list_init
(
&
session
->
hdr
.
children
);
session
->
resolve_timeout
=
DEFAULT_RESOLVE_TIMEOUT
;
session
->
connect_timeout
=
DEFAULT_CONNECT_TIMEOUT
;
session
->
send_timeout
=
DEFAULT_SEND_TIMEOUT
;
...
...
@@ -498,6 +499,7 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
connect
->
hdr
.
callback
=
session
->
hdr
.
callback
;
connect
->
hdr
.
notify_mask
=
session
->
hdr
.
notify_mask
;
connect
->
hdr
.
context
=
session
->
hdr
.
context
;
list_init
(
&
connect
->
hdr
.
children
);
addref_object
(
&
session
->
hdr
);
connect
->
session
=
session
;
...
...
@@ -505,9 +507,7 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
if
(
!
(
connect
->
hostname
=
strdupW
(
server
)))
goto
end
;
connect
->
hostport
=
port
;
if
(
!
set_server_for_hostname
(
connect
,
server
,
port
))
goto
end
;
if
(
!
set_server_for_hostname
(
connect
,
server
,
port
))
goto
end
;
if
(
!
(
hconnect
=
alloc_handle
(
&
connect
->
hdr
)))
goto
end
;
connect
->
hdr
.
handle
=
hconnect
;
...
...
@@ -516,7 +516,7 @@ HINTERNET WINAPI WinHttpConnect( HINTERNET hsession, LPCWSTR server, INTERNET_PO
end:
release_object
(
&
connect
->
hdr
);
release_object
(
&
session
->
hdr
);
TRACE
(
"returning %p
\n
"
,
hconnect
);
return
hconnect
;
}
...
...
@@ -930,6 +930,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
request
->
hdr
.
callback
=
connect
->
hdr
.
callback
;
request
->
hdr
.
notify_mask
=
connect
->
hdr
.
notify_mask
;
request
->
hdr
.
context
=
connect
->
hdr
.
context
;
list_init
(
&
request
->
hdr
.
children
);
addref_object
(
&
connect
->
hdr
);
request
->
connect
=
connect
;
...
...
@@ -970,7 +971,7 @@ HINTERNET WINAPI WinHttpOpenRequest( HINTERNET hconnect, LPCWSTR verb, LPCWSTR o
end:
release_object
(
&
request
->
hdr
);
release_object
(
&
connect
->
hdr
);
TRACE
(
"returning %p
\n
"
,
hrequest
);
return
hrequest
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment