aboutsummaryrefslogtreecommitdiff
path: root/src/pki.c
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2018-09-01 09:28:59 +0200
committerAndreas Schneider <asn@cryptomilk.org>2018-09-01 09:41:11 +0200
commit8323cd791f792b27d2717c24859d78e8f2faf555 (patch)
treece87330d4024f801cd37679fd36b25d4c1228723 /src/pki.c
parent461ebd1e2fa7649397348321dc3d702a7d49e18d (diff)
downloadlibssh-8323cd791f792b27d2717c24859d78e8f2faf555.tar.gz
libssh-8323cd791f792b27d2717c24859d78e8f2faf555.tar.xz
libssh-8323cd791f792b27d2717c24859d78e8f2faf555.zip
pki: Fix a memory leak in ssh_pki_do_sign()
CID 1395335 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Diffstat (limited to 'src/pki.c')
-rw-r--r--src/pki.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pki.c b/src/pki.c
index 2531fbed..821df576 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1903,8 +1903,10 @@ ssh_string ssh_pki_do_sign(ssh_session session,
SSH_LOG(SSH_LOG_TRACE, "Unknown hash algorithm for type: %d",
sig->type);
ssh_string_free(session_id);
+ ssh_buffer_free(buf);
return NULL;
}
+ ssh_buffer_free(buf);
#ifdef DEBUG_CRYPTO
ssh_print_hexa("Hash being signed", hash, hlen);