diff --git a/util.c b/util.c index 46cdf1f..c069246 100644 --- a/util.c +++ b/util.c @@ -160,11 +160,11 @@ gint g_unlinked_tmp(GError **error) // O_TMPFILE can be defined but still fail on some systems. if (fd == -1) { fd = g_file_open_tmp(NULL, &filename, error); - } - if (fd != -1) { - g_unlink(filename); - g_free(filename); + if (fd != -1) { + g_unlink(filename); + g_free(filename); + } } return fd; }