From 07473976e1ec6f8490b931452e0d859645fd9bd6 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 3 Sep 2018 18:07:58 +0200 Subject: [PATCH] pki_container: Use string functions for cleanup Signed-off-by: Andreas Schneider Reviewed-by: Jakub Jelen (cherry picked from commit c3980d433a02f00e2a4915278b90dfef804307a4) --- src/pki_container_openssh.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/pki_container_openssh.c b/src/pki_container_openssh.c index 53e1e7fe..2c4b6c46 100644 --- a/src/pki_container_openssh.c +++ b/src/pki_container_openssh.c @@ -133,11 +133,10 @@ static int pki_openssh_import_privkey_blob(ssh_buffer key_blob_buffer, return SSH_OK; fail: ssh_key_free(key); - if(privkey != NULL){ - memset(ssh_string_data(privkey), 0, ssh_string_len(privkey)); - } - SAFE_FREE(pubkey); - SAFE_FREE(privkey); + + ssh_string_burn(privkey); + ssh_string_free(privkey); + ssh_string_free(pubkey); return SSH_ERROR; }