summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2023-05-08 14:33:54 +0200
committerDaniel Stenberg <daniel@haxx.se>2023-05-08 16:47:03 +0200
commit8e21b1a05f3c0ee098dbcb6c3d84cb61f102a122 (patch)
treece44f86cbeab2e6b780c08162a77f9808d577411
parent5d36bdf490af6aeab3796660a044e1c0e1620ecc (diff)
downloadcurl-8e21b1a05f3c0ee098dbcb6c3d84cb61f102a122.tar.gz
libssh2: free fingerprint better
Reported-by: Wei Chong Tan Closes #11088
-rw-r--r--lib/vssh/libssh2.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/vssh/libssh2.c b/lib/vssh/libssh2.c
index bfcc94e16..dd39a844c 100644
--- a/lib/vssh/libssh2.c
+++ b/lib/vssh/libssh2.c
@@ -728,11 +728,10 @@ static CURLcode ssh_check_fingerprint(struct Curl_easy *data)
*/
if((pub_pos != b64_pos) ||
strncmp(fingerprint_b64, pubkey_sha256, pub_pos)) {
- free(fingerprint_b64);
-
failf(data,
"Denied establishing ssh session: mismatch sha256 fingerprint. "
"Remote %s is not equal to %s", fingerprint_b64, pubkey_sha256);
+ free(fingerprint_b64);
state(data, SSH_SESSION_FREE);
sshc->actualcode = CURLE_PEER_FAILED_VERIFICATION;
return sshc->actualcode;