commit 84bc347c349f09dc692e8d760ba9af3d21b0f5af from: Stefan Sperling date: Thu Jul 14 11:28:52 2022 UTC unlink temporary files created during ssh signature verification commit - 88d2e9a2310b0c69f8c5f183f4e91de630a1deff commit + 84bc347c349f09dc692e8d760ba9af3d21b0f5af blob - 7084c6ce1b92b634c964d90d3ef6e32ce922a786 blob + 2de1e193e4c5cba31c0fc391b178414c4a5b8d9d --- lib/sigs.c +++ lib/sigs.c @@ -266,7 +266,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; @@ -393,6 +393,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)