aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2012-10-07 22:35:33 +0200
committerAndreas Schneider <asn@cryptomilk.org>2012-10-07 22:35:33 +0200
commit996b7cae265c0ab4154f0ff868877d9dd858f392 (patch)
tree8d3de570226b082a0c1d0c025e6c7e7be7ce0cf2 /src
parentb219d1890c624d918ba658445b991735f8b804db (diff)
downloadlibssh-996b7cae265c0ab4154f0ff868877d9dd858f392.tar.gz
libssh-996b7cae265c0ab4154f0ff868877d9dd858f392.tar.xz
libssh-996b7cae265c0ab4154f0ff868877d9dd858f392.zip
pki: Make sure we don't double free pointers.
Diffstat (limited to 'src')
-rw-r--r--src/pki_crypto.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/pki_crypto.c b/src/pki_crypto.c
index 708ec1e4..a184eb44 100644
--- a/src/pki_crypto.c
+++ b/src/pki_crypto.c
@@ -774,12 +774,16 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
ssh_string_burn(p);
ssh_string_free(p);
+ p = NULL;
ssh_string_burn(g);
ssh_string_free(g);
+ g = NULL;
ssh_string_burn(q);
ssh_string_free(q);
+ q = NULL;
ssh_string_burn(n);
ssh_string_free(n);
+ n = NULL;
break;
case SSH_KEYTYPE_RSA:
@@ -803,8 +807,10 @@ ssh_string pki_publickey_to_blob(const ssh_key key)
ssh_string_burn(e);
ssh_string_free(e);
+ e = NULL;
ssh_string_burn(n);
ssh_string_free(n);
+ n = NULL;
break;
case SSH_KEYTYPE_ECDSA: