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
e9ffa9a3
Commit
e9ffa9a3
authored
18 years ago
by
Dan Fandrich
Browse files
Options
Downloads
Patches
Plain Diff
Fixed a few memory leaks in OOM conditions.
Made libssh2 logging more verbose when debugging is enabled.
parent
248a5381
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/ssh.c
+6
-5
6 additions, 5 deletions
lib/ssh.c
with
6 additions
and
5 deletions
lib/ssh.c
+
6
−
5
View file @
e9ffa9a3
...
...
@@ -305,12 +305,12 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
libssh2_realloc
,
ssh
);
if
(
ssh
->
ssh_session
==
NULL
)
{
failf
(
data
,
"Failure initialising ssh session
\n
"
);
Curl_safefree
(
ssh
->
path
);
Curl_safefree
(
working_path
);
return
CURLE_FAILED_INIT
;
}
#ifdef CURL_LIBSSH2_DEBUG
libssh2_trace
(
ssh
->
ssh_session
,
LIBSSH2_TRACE_CONN
|
LIBSSH2_TRACE_TRANS
|
LIBSSH2_TRACE_SCP
|
LIBSSH2_TRACE_SFTP
|
LIBSSH2_TRACE_ERROR
);
libssh2_trace
(
ssh
->
ssh_session
,
LIBSSH2_TRACE_CONN
|
LIBSSH2_TRACE_TRANS
|
LIBSSH2_TRACE_
KEX
|
LIBSSH2_TRACE_AUTH
|
LIBSSH2_TRACE_
SCP
|
LIBSSH2_TRACE_SFTP
|
LIBSSH2_TRACE_ERROR
|
LIBSSH2_TRACE_PUBLICKEY
);
infof
(
data
,
"SSH socket: %d
\n
"
,
sock
);
#endif
/* CURL_LIBSSH2_DEBUG */
...
...
@@ -318,7 +318,6 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
failf
(
data
,
"Failure establishing ssh session
\n
"
);
libssh2_session_free
(
ssh
->
ssh_session
);
ssh
->
ssh_session
=
NULL
;
Curl_safefree
(
ssh
->
path
);
Curl_safefree
(
working_path
);
return
CURLE_FAILED_INIT
;
}
...
...
@@ -357,7 +356,6 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
if
(
!
authlist
)
{
libssh2_session_free
(
ssh
->
ssh_session
);
ssh
->
ssh_session
=
NULL
;
Curl_safefree
(
ssh
->
path
);
Curl_safefree
(
working_path
);
return
CURLE_OUT_OF_MEMORY
;
}
...
...
@@ -437,7 +435,6 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
failf
(
data
,
"Authentication failure
\n
"
);
libssh2_session_free
(
ssh
->
ssh_session
);
ssh
->
ssh_session
=
NULL
;
Curl_safefree
(
ssh
->
path
);
Curl_safefree
(
working_path
);
return
CURLE_FAILED_INIT
;
}
...
...
@@ -511,6 +508,8 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
ssh
->
sftp_session
=
NULL
;
libssh2_session_free
(
ssh
->
ssh_session
);
ssh
->
ssh_session
=
NULL
;
Curl_safefree
(
ssh
->
homedir
);
ssh
->
homedir
=
NULL
;
Curl_safefree
(
working_path
);
return
CURLE_OUT_OF_MEMORY
;
}
...
...
@@ -530,6 +529,8 @@ CURLcode Curl_ssh_connect(struct connectdata *conn, bool *done)
ssh
->
sftp_session
=
NULL
;
libssh2_session_free
(
ssh
->
ssh_session
);
ssh
->
ssh_session
=
NULL
;
Curl_safefree
(
ssh
->
homedir
);
ssh
->
homedir
=
NULL
;
Curl_safefree
(
working_path
);
return
CURLE_OUT_OF_MEMORY
;
}
...
...
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