pki_container: Use string functions for cleanup

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
This commit is contained in:
Andreas Schneider
2018-09-03 18:07:58 +02:00
parent 78498ee289
commit c3980d433a

View File

@@ -133,11 +133,10 @@ static int pki_openssh_import_privkey_blob(ssh_buffer key_blob_buffer,
return SSH_OK; return SSH_OK;
fail: fail:
ssh_key_free(key); ssh_key_free(key);
if(privkey != NULL){
memset(ssh_string_data(privkey), 0, ssh_string_len(privkey)); ssh_string_burn(privkey);
} ssh_string_free(privkey);
SAFE_FREE(pubkey); ssh_string_free(pubkey);
SAFE_FREE(privkey);
return SSH_ERROR; return SSH_ERROR;
} }