pki_container: Use string functions for cleanup

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Jelen <jjelen@redhat.com>
(cherry picked from commit c3980d433a)
This commit is contained in:
Andreas Schneider
2018-09-03 18:07:58 +02:00
parent 51063fe07e
commit 07473976e1

View File

@@ -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;
}