From 986b79874567caba035c125cd675edc89bea49c9 Mon Sep 17 00:00:00 2001 From: rbuj Date: Thu, 21 Oct 2021 16:15:39 +0200 Subject: datetime: fix memory leak --- plugins/datetime/msd-datetime-mechanism.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'plugins/datetime') diff --git a/plugins/datetime/msd-datetime-mechanism.c b/plugins/datetime/msd-datetime-mechanism.c index d94d575..0a2e32e 100644 --- a/plugins/datetime/msd-datetime-mechanism.c +++ b/plugins/datetime/msd-datetime-mechanism.c @@ -225,7 +225,7 @@ msd_datetime_mechanism_new (void) static gboolean _check_polkit_for_action (MsdDatetimeMechanism *mechanism, DBusGMethodInvocation *context, const char *action) { - const char *sender; + char *sender; GError *error; PolkitSubject *subject; PolkitAuthorizationResult *result; @@ -235,6 +235,7 @@ _check_polkit_for_action (MsdDatetimeMechanism *mechanism, DBusGMethodInvocation /* Check that caller is privileged */ sender = dbus_g_method_get_sender (context); subject = polkit_system_bus_name_new (sender); + g_free (sender); result = polkit_authority_check_authorization_sync (mechanism->priv->auth, subject, @@ -581,7 +582,7 @@ check_can_do (MsdDatetimeMechanism *mechanism, const char *action, DBusGMethodInvocation *context) { - const char *sender; + char *sender; PolkitSubject *subject; PolkitAuthorizationResult *result; GError *error; @@ -589,6 +590,7 @@ check_can_do (MsdDatetimeMechanism *mechanism, /* Check that caller is privileged */ sender = dbus_g_method_get_sender (context); subject = polkit_system_bus_name_new (sender); + g_free (sender); error = NULL; result = polkit_authority_check_authorization_sync (mechanism->priv->auth, -- cgit v1.2.1