diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c index 0e7c2eb98..891e945f7 100644 --- a/lib/vssh/libssh2.c +++ b/lib/vssh/libssh2.c @@ -3159,6 +3159,7 @@ static CURLcode ssh_connect(struct Curl_easy *data, bool *done) sshc->kh = libssh2_knownhost_init(sshc->ssh_session); if(!sshc->kh) { libssh2_session_free(sshc->ssh_session); + sshc->ssh_session = NULL; return CURLE_FAILED_INIT; }