verify-tag: Clean up the temporary file if gpg cannot be started.
Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Johannes Sixt committed
Apr 2, 2008 at 08:49 UTC
69fe5ef6c7211921a2a7840698bf58a80bab9412
1 file changed
+3
-1
builtin-verify-tag.c
+3
-1
@@ -46,8 +46,10 @@ static int run_gpg_verify(const char *buf, unsigned long size, int verbose)
46
gpg.argv = args_gpg;
47
gpg.in = -1;
48
args_gpg[2] = path;
49
- if (start_command(&gpg))
49
+ if (start_command(&gpg)) {
50
+ unlink(path);
51
return error("could not run gpg.");
52
+ }
53
54
write_in_full(gpg.in, buf, len);
55
close(gpg.in);