Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
TLMSP curl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CYBER - Cyber Security
TS 103 523 MSP
TLMSP
TLMSP curl
Commits
46e09372
Commit
46e09372
authored
24 years ago
by
Daniel Stenberg
Browse files
Options
Downloads
Patches
Plain Diff
corrected memory leaks when re-using connections
parent
a1d6ad26
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/http.c
+11
-1
11 additions, 1 deletion
lib/http.c
lib/url.c
+4
-0
4 additions, 0 deletions
lib/url.c
with
15 additions
and
1 deletion
lib/http.c
+
11
−
1
View file @
46e09372
...
...
@@ -421,6 +421,8 @@ CURLcode Curl_http(struct connectdata *conn)
sprintf
(
data
->
buffer
,
"%s:%s"
,
data
->
user
,
data
->
passwd
);
if
(
Curl_base64_encode
(
data
->
buffer
,
strlen
(
data
->
buffer
),
&
authorization
)
>=
0
)
{
if
(
data
->
ptr_userpwd
)
free
(
data
->
ptr_userpwd
);
data
->
ptr_userpwd
=
aprintf
(
"Authorization: Basic %s
\015\012
"
,
authorization
);
free
(
authorization
);
...
...
@@ -428,9 +430,13 @@ CURLcode Curl_http(struct connectdata *conn)
}
}
if
((
data
->
bits
.
http_set_referer
)
&&
!
checkheaders
(
data
,
"Referer:"
))
{
if
(
data
->
ptr_ref
)
free
(
data
->
ptr_ref
);
data
->
ptr_ref
=
aprintf
(
"Referer: %s
\015\012
"
,
data
->
referer
);
}
if
(
data
->
cookie
&&
!
checkheaders
(
data
,
"Cookie:"
))
{
if
(
data
->
ptr_cookie
)
free
(
data
->
ptr_cookie
);
data
->
ptr_cookie
=
aprintf
(
"Cookie: %s
\015\012
"
,
data
->
cookie
);
}
...
...
@@ -450,7 +456,11 @@ CURLcode Curl_http(struct connectdata *conn)
http
->
sendit
=
Curl_getFormData
(
data
->
httppost
,
&
http
->
postsize
);
}
if
(
!
checkheaders
(
data
,
"Host:"
))
{
if
(
!
checkheaders
(
data
,
"Host:"
)
&&
!
data
->
ptr_host
)
{
/* if ptr_host is already set, it is OK since we only re-use connections
to the very same host and port */
if
(((
conn
->
protocol
&
PROT_HTTPS
)
&&
(
data
->
remote_port
==
PORT_HTTPS
))
||
(
!
(
conn
->
protocol
&
PROT_HTTPS
)
&&
(
data
->
remote_port
==
PORT_HTTP
))
)
/* If (HTTPS on port 443) OR (non-HTTPS on port 80) then don't include
...
...
This diff is collapsed.
Click to expand it.
lib/url.c
+
4
−
0
View file @
46e09372
...
...
@@ -1653,6 +1653,8 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
data
->
proxyuser
,
data
->
proxypasswd
);
if
(
Curl_base64_encode
(
data
->
buffer
,
strlen
(
data
->
buffer
),
&
authorization
)
>=
0
)
{
if
(
data
->
ptr_proxyuserpwd
)
free
(
data
->
ptr_proxyuserpwd
);
data
->
ptr_proxyuserpwd
=
aprintf
(
"Proxy-authorization: Basic %s
\015\012
"
,
authorization
);
free
(
authorization
);
...
...
@@ -1665,6 +1667,8 @@ static CURLcode _connect(CURL *curl, CURLconnect **in_connect)
*************************************************************/
if
((
conn
->
protocol
&
PROT_HTTP
)
||
data
->
bits
.
httpproxy
)
{
if
(
data
->
useragent
)
{
if
(
data
->
ptr_uagent
)
free
(
data
->
ptr_uagent
);
data
->
ptr_uagent
=
aprintf
(
"User-Agent: %s
\015\012
"
,
data
->
useragent
);
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment