aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDirkjan Bussink <d.bussink@gmail.com>2020-09-03 17:15:18 +0200
committerDirkjan Bussink <d.bussink@gmail.com>2020-09-03 17:16:18 +0200
commite4c5f6d3d9bff233a39abe7810ba76019572fd2f (patch)
tree9b78f478af9891d8d7eea81f26d71b692cc383f9 /src
parentb052f665c99bbcd8a1d8dd2b1076f25524657350 (diff)
downloadlibssh-e4c5f6d3d9bff233a39abe7810ba76019572fd2f.tar.gz
libssh-e4c5f6d3d9bff233a39abe7810ba76019572fd2f.tar.xz
libssh-e4c5f6d3d9bff233a39abe7810ba76019572fd2f.zip
Fix another memory leak on invalid nid value
In 906cc7e7e95047981677a43743cb7c4aa2bb3aab a memory leak was fixed but a similar one is present here that needs a fix as well. Signed-off-by: Dirkjan Bussink <d.bussink@gmail.com> Reviewed-by: Jakub Jelen <jjelen@redhat.com>
Diffstat (limited to 'src')
-rw-r--r--src/pki.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pki.c b/src/pki.c
index a379d6c7..0d86fbcd 100644
--- a/src/pki.c
+++ b/src/pki.c
@@ -1218,6 +1218,10 @@ int pki_import_privkey_buffer(enum ssh_keytypes_e type,
nid = pki_key_ecdsa_nid_from_name(ssh_string_get_char(i));
SSH_STRING_FREE(i);
if (nid == -1) {
+ ssh_string_burn(e);
+ SSH_STRING_FREE(e);
+ ssh_string_burn(exp);
+ SSH_STRING_FREE(exp);
goto fail;
}