From f9d5c5cba9c0020ca179b04afee49e0918c194b2 Mon Sep 17 00:00:00 2001 From: Sebastian Wick Date: Thu, 20 Nov 2025 22:05:28 +0100 Subject: [PATCH] dir: Free result of polkit_subject_to_string Fixes: 1372e16d ("dir: Check parental control authorization via system bus name") --- common/flatpak-dir.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c index 1ff4218e..929063d1 100644 --- a/common/flatpak-dir.c +++ b/common/flatpak-dir.c @@ -17351,12 +17351,15 @@ static void ...) { #ifdef HAVE_LIBSYSTEMD - const char *installation = source ? source : flatpak_dir_get_name_cached (self); - const char *subject = self->subject ? polkit_subject_to_string (self->subject) : "(none)"; + const char *installation; + g_autofree char *subject = NULL; char message[1024]; int len; va_list args; + installation = source ? source : flatpak_dir_get_name_cached (self); + subject = self->subject ? polkit_subject_to_string (self->subject) : g_strdup ("(none)"); + len = g_snprintf (message, sizeof (message), "%s: ", installation); va_start (args, format);