mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-08-08 19:02:06 +03:00
legacy: Don't leak the key struct on error.
Found by Coverity.
This commit is contained in:
@@ -485,6 +485,7 @@ ssh_string publickey_from_file(ssh_session session, const char *filename,
|
||||
|
||||
rc = ssh_pki_export_pubkey_blob(key, &key_str);
|
||||
if (rc < 0) {
|
||||
ssh_key_free(key);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user