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
ae4558db
Commit
ae4558db
authored
12 years ago
by
Marc Hoersken
Browse files
Options
Downloads
Patches
Plain Diff
curl_schannel.c: Fixed memory leak if connection was not successful
parent
ee7669ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/curl_schannel.c
+14
-0
14 additions, 0 deletions
lib/curl_schannel.c
with
14 additions
and
0 deletions
lib/curl_schannel.c
+
14
−
0
View file @
ae4558db
...
...
@@ -1063,6 +1063,7 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
*/
struct
SessionHandle
*
data
=
conn
->
data
;
struct
ssl_connect_data
*
connssl
=
&
conn
->
ssl
[
sockindex
];
struct
curl_schannel_cred
*
cached_cred
=
NULL
;
infof
(
data
,
"schannel: shutting down SSL/TLS connection with %s port %hu
\n
"
,
conn
->
host
.
name
,
conn
->
remote_port
);
...
...
@@ -1126,6 +1127,7 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
/* free SSPI Schannel API security context handle */
if
(
connssl
->
ctxt
)
{
infof
(
data
,
"schannel: clear security context handle
\n
"
);
s_pSecFn
->
DeleteSecurityContext
(
&
connssl
->
ctxt
->
ctxt_handle
);
Curl_safefree
(
connssl
->
ctxt
);
}
...
...
@@ -1136,6 +1138,18 @@ int Curl_schannel_shutdown(struct connectdata *conn, int sockindex)
infof
(
data
,
"schannel: decremented credential handle refcount = %d
\n
"
,
connssl
->
cred
->
refcount
);
}
/* if the handle refcount is zero, check if we have not cached it */
if
(
connssl
->
cred
&&
connssl
->
cred
->
refcount
==
0
)
{
/* if the handle was not cached, it is stale to be freed */
if
(
!
Curl_ssl_getsessionid
(
conn
,
(
void
**
)
&
cached_cred
,
NULL
))
{
if
(
connssl
->
cred
!=
cached_cred
)
{
infof
(
data
,
"schannel: clear credential handle
\n
"
);
s_pSecFn
->
FreeCredentialsHandle
(
&
connssl
->
cred
->
cred_handle
);
Curl_safefree
(
connssl
->
cred
);
}
}
}
}
/* free internal buffer for received encrypted data */
...
...
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