diff options
author | Dirkjan Bussink <d.bussink@gmail.com> | 2020-09-03 17:15:18 +0200 |
---|---|---|
committer | Jakub Jelen <jjelen@redhat.com> | 2021-08-17 11:02:47 +0200 |
commit | 1fc8266fcb3df711638b7a154171247e527c82dd (patch) | |
tree | deacbba0f57c74c68916ca878eeec71b1dcd99d0 | |
parent | 0cceefd49d4d397eb21bd36e314ac87739da51ff (diff) | |
download | libssh-1fc8266fcb3df711638b7a154171247e527c82dd.tar.gz libssh-1fc8266fcb3df711638b7a154171247e527c82dd.tar.xz libssh-1fc8266fcb3df711638b7a154171247e527c82dd.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>
(cherry picked from commit e4c5f6d3d9bff233a39abe7810ba76019572fd2f)
-rw-r--r-- | src/pki.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -1160,6 +1160,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; } |