Commit Diff


commit - a42c5a8d17b08b394d58b6db11a853b2185a0562
commit + 9b46414321413a8a9c59995ef117f2faea7d7453
blob - 9303d8b25c0edfd6ef4c036908c27a9606b9bedd
blob + 4af447359ea258795b19a825ab5b6245b33d9409
--- lib/sigs.c
+++ lib/sigs.c
@@ -264,7 +264,7 @@ got_sigs_verify_tag_ssh(char **msg, struct got_tag_obj
 	int pid, status, in_pfd[2], out_pfd[2];
 	char* parsed_identity = NULL;
 	const char *identity;
-	char* tmppath = NULL;
+	char *tmppath = NULL;
 	FILE *tmpsig = NULL;
 	BUF *buf;
 	int i = 0, j;
@@ -391,6 +391,8 @@ got_sigs_verify_tag_ssh(char **msg, struct got_tag_obj
 
 done:
 	free(parsed_identity);
+	if (tmppath && unlink(tmppath) == -1 && error == NULL)
+		error = got_error_from_errno("unlink");
 	free(tmppath);
 	close(out_pfd[0]);
 	if (tmpsig && fclose(tmpsig) == EOF && error == NULL)