aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-07 22:36:06 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-07 22:36:06 +0200
commit5f0f334d1c8922396949b2822a6e1bebb9c42b7c (patch)
treee7d43e497ef99d92be81b7bb4dffdfa3f6299443
parent996b7cae265c0ab4154f0ff868877d9dd858f392 (diff)
downloadlibssh-5f0f334d1c8922396949b2822a6e1bebb9c42b7c.tar.gz
libssh-5f0f334d1c8922396949b2822a6e1bebb9c42b7c.tar.xz
libssh-5f0f334d1c8922396949b2822a6e1bebb9c42b7c.zip
pki: Don't leak memory in pubkey to blob.
-rw-r--r--src/pki_crypto.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index a184eb44..b0d8660e 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -855,12 +855,13 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
rc = buffer_add_ssh_string(buffer, e);
if (rc < 0) {
-
- ssh_string_burn(e);
- ssh_string_free(e);
goto fail;
}
+ ssh_string_burn(e);
+ ssh_string_free(e);
+ e = NULL;
+
break;
#endif
case SSH_KEYTYPE_UNKNOWN: