aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2015-09-09 09:34:22 +0200
committerAndreas Schneider <asn@cryptomilk.org>2015-09-09 09:34:22 +0200
commit11f43df873e5d684b8ed9244b6a00c0ece2f8d5e (patch)
tree1ef8eeac9612279b0cb35d15a6eedfd034c1431a /src/pki.c
parent1254ed1833b4a09409f57ba5e3b45573ecfde89f (diff)
downloadlibssh-11f43df873e5d684b8ed9244b6a00c0ece2f8d5e.tar.gz
libssh-11f43df873e5d684b8ed9244b6a00c0ece2f8d5e.tar.xz
libssh-11f43df873e5d684b8ed9244b6a00c0ece2f8d5e.zip
pki: Fix a memory leak on error in ssh_pki_copy_cert_to_privkey()
CID 1323516 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/pki.c b/src/pki.c
index e0209cd6..22143cb6 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1408,6 +1408,7 @@ int ssh_pki_copy_cert_to_privkey(const ssh_key certkey, ssh_key privkey) {
rc = buffer_add_buffer(cert_buffer, certkey->cert);
if (rc != 0) {
+ ssh_buffer_free(cert_buffer);
return SSH_ERROR;
}