mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-07-31 00:03:07 +03:00
Avoid resource leak of key
Signed-off-by: Sahana Prasad <sahana@redhat.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
@ -310,6 +310,7 @@ list_fingerprint(char *file)
|
||||
rc = ssh_get_publickey_hash(key, SSH_PUBLICKEY_HASH_SHA256, &hash, &hlen);
|
||||
if (rc != SSH_OK) {
|
||||
fprintf(stderr, "Failed to get key fingerprint\n");
|
||||
ssh_key_free(key);
|
||||
return;
|
||||
}
|
||||
ssh_print_hash(SSH_PUBLICKEY_HASH_SHA256, hash, hlen);
|
||||
|
Reference in New Issue
Block a user