From 9d60df4d0c889d2ff6d3d0f8bd71998f9bc49f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Hubert=20Figui=C3=A8re?= Date: Sun, 12 May 2024 17:37:54 -0400 Subject: [PATCH] flatpak-dir: Fix a memory leak when installing a package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The path was clobbered make the g_autoptr no work Signed-off-by: Hubert Figuière --- common/flatpak-dir.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 3c3acbd9..dfe69cf5 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -1952,6 +1952,8 @@ flatpak_ensure_system_user_cache_dir_location (GError **error) (st_buf.st_mode & 0777) == 0755) return g_file_new_for_path (path); + g_clear_pointer (&path, g_free); + path = g_strdup ("/var/tmp/flatpak-cache-XXXXXX"); if (g_mkdtemp_full (path, 0755) == NULL)