Skip to contentSkip to conversation

verify-tag: Clean up the temporary file if gpg cannot be started.

PATCH New Johannes Sixt 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 verify-tag: Clean up the temporary file if gpg cannot be started.

From: Johannes Sixt <[email protected]>

---
 builtin-verify-tag.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
builtin-verify-tag.c +3 -1
index f3ef11f..db81496 100644
@@ -46,8 +46,10 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose)
 	gpg.argv = args_gpg;
 	gpg.in = -1;
 	args_gpg[2] = path;
-	if (start_command(&gpg))
+	if (start_command(&gpg)) {
+		unlink(path);
 		return error("could not run gpg.");
+	}
 
 	write_in_full(gpg.in, buf, len);
 	close(gpg.in);
Signature · 1 line
1.5.5.rc2.861.g18c5b.dirty