When GetTemporaryFile() has a fdopen() failure, it closes the file descriptor but does not delete the temporary file created by the immediately preceding g_mkstemp(). As a result, an unnecessary temporary file remains upon error. This has been fixed to also perform g_unlink() in the fdopen() failure handling.
I have attached a patch. Best regards, -- TAKAHASHI Kaoru
>From 969a95559f989612afd64eef15395fc4651d9e86 Mon Sep 17 00:00:00 2001 From: TAKAHASHI Kaoru <[email protected]> Date: Sun, 23 Aug 2026 11:48:35 +0900 Subject: [PATCH] GetTemporaryFile(): Unlink temprary file on fdopen() failure --- util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/util.c b/util.c index bd9b0464..73f2c235 100644 --- a/util.c +++ b/util.c @@ -21,6 +21,7 @@ #include <stdlib.h> #include <string.h> #include <errno.h> +#include <glib/gstdio.h> #include "common.h" char *prefsdir = NULL; @@ -161,6 +162,7 @@ GetTemporaryFile(const char *nameTemplate, char **retName) close(tmpd); #endif if (retName && *retName) { + g_unlink(*retName); g_free(*retName); *retName = NULL; } -- 2.47.3
