aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 21:05:53 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:07:01 +0200
commit029d165b61d3c36c046a44d80fad6de1b2504eab (patch)
treec911b436bacc206c15f37d606d10551dbadcb370 /src
parent4e7736444f6eabbd1b0e8b7068b1bb587066c8ac (diff)
downloadlibssh-029d165b61d3c36c046a44d80fad6de1b2504eab.tar.gz
libssh-029d165b61d3c36c046a44d80fad6de1b2504eab.tar.xz
libssh-029d165b61d3c36c046a44d80fad6de1b2504eab.zip
legacy: Don't leak the key struct on error.
Found by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/legacy.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/legacy.c b/src/legacy.c
index f735f682..ba04c79d 100644
--- a/src/legacy.c
+++ b/src/legacy.c
@@ -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;
}