[PATCH] ssh signing: don't detach the filename strbuf from key_file tempfile
- From
redoste <redoste@redoste.xyz>
- Date
- Jul 4, 2025, 23:08 UTC
- Message-ID
- <20250704230829.29696-1-redoste@redoste.xyz>
Detaching the filename string from the tempfile structure used to cause delete_tempfile() to fail and the temporary file was not cleaned up.
Signed-off-by: redoste <redoste@redoste.xyz> --- gpg-interface.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/gpg-interface.c b/gpg-interface.c index 0896458de5..bdcc8c2a2e 100644 --- a/gpg-interface.c +++ b/gpg-interface.c @@ -1048,7 +1048,7 @@ static int sign_buffer_ssh(struct strbuf *buffer, struct strbuf *signature, key_file->filename.buf); goto out; } - ssh_signing_key_file = strbuf_detach(&key_file->filename, NULL); + ssh_signing_key_file = xstrdup(key_file->filename.buf); } else { /* We assume a file */ ssh_signing_key_file = interpolate_path(signing_key, 1);
-- 2.49.0