aboutsummaryrefslogtreecommitdiff
path: root/internal/crud/cli_new_ssh.go
diff options
context:
space:
mode:
authorishaan <contact@ishaan.cc>2026-08-20 14:03:30 +0530
committerishaan <contact@ishaan.cc>2026-08-20 14:03:30 +0530
commit7caaf4c96d4f657d9193baf48e9745c9f68181c9 (patch)
treeabcdb288540f465b1e39a9c6fa4b6bf94cefa65e /internal/crud/cli_new_ssh.go
parentc7b546fb94687a6cbe9bab9db041d15104c5111d (diff)
fix: wipe temp file before removal to prevent leak
Diffstat (limited to 'internal/crud/cli_new_ssh.go')
-rw-r--r--internal/crud/cli_new_ssh.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/crud/cli_new_ssh.go b/internal/crud/cli_new_ssh.go
index 5479490..2a69223 100644
--- a/internal/crud/cli_new_ssh.go
+++ b/internal/crud/cli_new_ssh.go
@@ -192,8 +192,8 @@ func NewNoteSSHEdit(output string, defaultPubKeyBytes []byte, defaultPrivKeyPath
crypt.TryMlock(plaintext)
defer clear(plaintext)
- defer deferredCleanTmpFile(tmpFile, len(plaintext))
defer os.Remove(tmpFile.Name())
+ defer deferredCleanTmpFile(tmpFile, len(plaintext))
_, err = tmpFile.Write(plaintext)
if err != nil {