aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-08-20 10:37:19 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-08-20 10:37:19 -0400
commit9b0e8561f00d30913681f3ed9e2ddad4ef916512 (patch)
treef38b6fd60a36b82e1247ff60ef28e694cd9517ff
parent41eb56a04a808b6fdf1a18a93466f0586d161820 (diff)
downloadstasis-pypi-existence-check.tar.gz
Ensure the temporary output file does not lingerpypi-existence-check
-rw-r--r--src/conda.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/conda.c b/src/conda.c
index f7c7250..ff55f14 100644
--- a/src/conda.c
+++ b/src/conda.c
@@ -109,6 +109,7 @@ int pip_index_provides(const char *index_url, const char *name, const char *vers
int logfd = mkstemp(logfile);
if (logfd < 0) {
perror(logfile);
+ remove(logfile); // fail harmlessly if not present
return -1;
}
@@ -139,9 +140,9 @@ int pip_index_provides(const char *index_url, const char *name, const char *vers
}
fflush(stderr);
fclose(fp);
- remove(logfile);
}
}
+ remove(logfile);
return proc.returncode == 0;
}