From f576dc74dee4ae2552af6d00000e3b55ac256057 Mon Sep 17 00:00:00 2001 From: monsieurleberre Date: Mon, 8 Apr 2019 13:35:44 +0100 Subject: [PATCH] Use a copy of the passphrase in ctor, dispose it when diposing the instance --- src/IpfsEngine.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/IpfsEngine.cs b/src/IpfsEngine.cs index dcf92fa8..41b72a07 100644 --- a/src/IpfsEngine.cs +++ b/src/IpfsEngine.cs @@ -66,7 +66,7 @@ public IpfsEngine(char[] passphrase) /// public IpfsEngine(SecureString passphrase) { - this.passphrase = passphrase; + this.passphrase = passphrase.Copy(); Init(); } @@ -430,6 +430,7 @@ public async Task StopAsync() /// public void Dispose() { + passphrase?.Dispose(); StopAsync().Wait(); }