summaryrefslogtreecommitdiff
path: root/libs/libcurl/src/vssh/libssh2.c
diff options
context:
space:
mode:
authordartraiden <wowemuh@gmail.com>2023-03-22 14:58:20 +0300
committerdartraiden <wowemuh@gmail.com>2023-03-22 15:00:13 +0300
commit95538ee3e112abd86c963c246d994a533d2b366d (patch)
tree03bca2a3cac1da684e43d95aab0fffd9236cbcf9 /libs/libcurl/src/vssh/libssh2.c
parent7c3c13800855033b8d5c5ffe08b3586456fa0b7b (diff)
libcurl: update to 8.0.1
Diffstat (limited to 'libs/libcurl/src/vssh/libssh2.c')
-rw-r--r--libs/libcurl/src/vssh/libssh2.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libs/libcurl/src/vssh/libssh2.c b/libs/libcurl/src/vssh/libssh2.c
index 19ad6c2f66..edc1c8f158 100644
--- a/libs/libcurl/src/vssh/libssh2.c
+++ b/libs/libcurl/src/vssh/libssh2.c
@@ -100,10 +100,11 @@
/* Local functions: */
static const char *sftp_libssh2_strerror(unsigned long err);
+#ifdef CURL_LIBSSH2_DEBUG
static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc);
static LIBSSH2_REALLOC_FUNC(my_libssh2_realloc);
static LIBSSH2_FREE_FUNC(my_libssh2_free);
-
+#endif
static CURLcode ssh_force_knownhost_key_type(struct Curl_easy *data);
static CURLcode ssh_connect(struct Curl_easy *data, bool *done);
static CURLcode ssh_multi_statemach(struct Curl_easy *data, bool *done);
@@ -283,6 +284,8 @@ static CURLcode libssh2_session_error_to_CURLE(int err)
return CURLE_SSH;
}
+#ifdef CURL_LIBSSH2_DEBUG
+
static LIBSSH2_ALLOC_FUNC(my_libssh2_malloc)
{
(void)abstract; /* arg not used */
@@ -302,6 +305,8 @@ static LIBSSH2_FREE_FUNC(my_libssh2_free)
free(ptr);
}
+#endif
+
/*
* SSH State machine related code
*/
@@ -2400,7 +2405,6 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
result = Curl_dyn_addf(&sshp->readdir, " -> %s", sshp->readdir_filename);
if(result) {
- sshc->readdir_line = NULL;
Curl_safefree(sshp->readdir_filename);
Curl_safefree(sshp->readdir_longentry);
state(data, SSH_SFTP_CLOSE);
@@ -3004,12 +3008,9 @@ static CURLcode ssh_statemach_act(struct Curl_easy *data, bool *block)
Curl_safefree(sshc->rsa_pub);
Curl_safefree(sshc->rsa);
-
Curl_safefree(sshc->quote_path1);
Curl_safefree(sshc->quote_path2);
-
Curl_safefree(sshc->homedir);
- Curl_safefree(sshc->readdir_line);
/* the code we are about to return */
result = sshc->actualcode;
@@ -3268,9 +3269,13 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done)
sock = conn->sock[FIRSTSOCKET];
#endif /* CURL_LIBSSH2_DEBUG */
+#ifdef CURL_LIBSSH2_DEBUG
sshc->ssh_session = libssh2_session_init_ex(my_libssh2_malloc,
my_libssh2_free,
my_libssh2_realloc, data);
+#else
+ sshc->ssh_session = libssh2_session_init();
+#endif
if(!sshc->ssh_session) {
failf(data, "Failure initialising ssh session");
return CURLE_FAILED_INIT;