diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 78bf71b90f..4136c4b554 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -926,8 +926,6 @@ jobs: TFLAGS+=' ~612' # SFTP if [[ '${{ matrix.install }}' = *'libssh2[core,zlib]'* ]]; then TFLAGS+=' ~SFTP' - elif [[ '${{ matrix.install }}' = *'libssh2'* ]]; then - TFLAGS+=' ~615 ~616 ~618 ~620 ~622' # Leak detected: memory still allocated: 22 bytes, allocated by D:/a/curl/curl/lib/vssh/libssh2.c:2006, sshc->homedir = strdup(sshp->readdir_filename); elif [[ '${{ matrix.install }}' = *'libssh '* ]]; then TFLAGS+=' ~614' # 'SFTP pre-quote chmod' SFTP, pre-quote, directory fi diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index eaaa922a71..1bc7a5e14d 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -2003,6 +2003,7 @@ static CURLcode ssh_statemachine(struct Curl_easy *data, bool *block) if(rc > 0) { /* It seems that this string is not always NULL terminated */ sshp->readdir_filename[rc] = '\0'; + free(sshc->homedir); sshc->homedir = strdup(sshp->readdir_filename); if(!sshc->homedir) { state(data, SSH_SFTP_CLOSE);