From 29c558ed1236674f2416741aecc63d6db3ef7b90 Mon Sep 17 00:00:00 2001 From: nhmall Date: Tue, 22 Sep 2020 10:11:51 -0400 Subject: [PATCH] follow-up bit; ensure the mkstemp() file is unlinked --- util/makedefs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/makedefs.c b/util/makedefs.c index 0cf4b09e3..147164fde 100644 --- a/util/makedefs.c +++ b/util/makedefs.c @@ -416,8 +416,10 @@ int flg UNUSED; if (istemp) { (void) snprintf(tmpfbuf, sizeof tmpfbuf, DATA_TEMPLATE, "mdXXXXXX"); tmpfd = mkstemp(tmpfbuf); - if (tmpfd >= 0) + if (tmpfd >= 0) { rv = fdopen(tmpfd, WRTMODE); /* temp file is always read+write */ + Unlink(tmpfbuf); + } } else #endif rv = fopen(name, mode);