Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
git2
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lvzhengyang
git2
Commits
43c55111
Commit
43c55111
authored
Jun 07, 2016
by
Patrick Steinhardt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winhttp: plug several memory leaks
parent
432af52b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
2 deletions
+16
-2
src/transports/winhttp.c
+16
-2
No files found.
src/transports/winhttp.c
View file @
43c55111
...
...
@@ -400,11 +400,17 @@ static int winhttp_stream_connect(winhttp_stream *s)
return
-
1
;
}
gitno_connection_data_free_ptrs
(
&
t
->
proxy_connection_data
);
if
((
error
=
gitno_extract_url_parts
(
&
t
->
proxy_connection_data
.
host
,
&
t
->
proxy_connection_data
.
port
,
NULL
,
&
t
->
proxy_connection_data
.
user
,
&
t
->
proxy_connection_data
.
pass
,
proxy_url
,
NULL
))
<
0
)
goto
on_error
;
if
(
t
->
proxy_connection_data
.
user
&&
t
->
proxy_connection_data
.
pass
)
{
if
(
t
->
proxy_cred
)
{
t
->
proxy_cred
->
free
(
t
->
proxy_cred
);
}
if
((
error
=
git_cred_userpass_plaintext_new
(
&
t
->
proxy_cred
,
t
->
proxy_connection_data
.
user
,
t
->
proxy_connection_data
.
pass
))
<
0
)
goto
on_error
;
}
...
...
@@ -425,10 +431,11 @@ static int winhttp_stream_connect(winhttp_stream *s)
}
/* Convert URL to wide characters */
if
((
error
=
git__utf8_to_16_alloc
(
&
proxy_wide
,
processed_url
.
ptr
))
<
0
)
error
=
git__utf8_to_16_alloc
(
&
proxy_wide
,
processed_url
.
ptr
);
git_buf_free
(
&
processed_url
);
if
(
error
<
0
)
goto
on_error
;
proxy_info
.
dwAccessType
=
WINHTTP_ACCESS_TYPE_NAMED_PROXY
;
proxy_info
.
lpszProxy
=
proxy_wide
;
proxy_info
.
lpszProxyBypass
=
NULL
;
...
...
@@ -1481,12 +1488,19 @@ static int winhttp_close(git_smart_subtransport *subtransport)
gitno_connection_data_free_ptrs
(
&
t
->
connection_data
);
memset
(
&
t
->
connection_data
,
0x0
,
sizeof
(
gitno_connection_data
));
gitno_connection_data_free_ptrs
(
&
t
->
proxy_connection_data
);
memset
(
&
t
->
proxy_connection_data
,
0x0
,
sizeof
(
gitno_connection_data
));
if
(
t
->
cred
)
{
t
->
cred
->
free
(
t
->
cred
);
t
->
cred
=
NULL
;
}
if
(
t
->
proxy_cred
)
{
t
->
proxy_cred
->
free
(
t
->
proxy_cred
);
t
->
proxy_cred
=
NULL
;
}
if
(
t
->
url_cred
)
{
t
->
url_cred
->
free
(
t
->
url_cred
);
t
->
url_cred
=
NULL
;
...
...
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