aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-08 20:53:45 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-12 08:07:01 +0200
commit7254390ac2cc548c28e9c4f85f3aa3bc56605e89 (patch)
tree2ee7e1342164dca948594e426839fcce38fd251e /src
parent188c5968032ffbd1764b631c0c8c3e54f7a3091a (diff)
downloadlibssh-7254390ac2cc548c28e9c4f85f3aa3bc56605e89.tar.gz
libssh-7254390ac2cc548c28e9c4f85f3aa3bc56605e89.tar.xz
libssh-7254390ac2cc548c28e9c4f85f3aa3bc56605e89.zip
pki: Don't leak the signature on error paths.
Found by Coverity.
Diffstat (limited to 'src')
-rw-r--r--src/pki_crypto.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index b0d8660e..0ec05d33 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -1227,6 +1227,7 @@ ssh_signature pki_signature_from_blob(const ssh_key pubkey,
#endif
case SSH_KEYTYPE_UNKNOWN:
ssh_pki_log("Unknown signature type");
+ ssh_signature_free(sig);
return NULL;
}
@@ -1391,6 +1392,7 @@ ssh_signature pki_do_sign_sessionid(const ssh_key key,
break;
#endif
case SSH_KEYTYPE_UNKNOWN:
+ ssh_signature_free(sig);
return NULL;
}