summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorrbuj <[email protected]>2021-10-21 16:15:39 +0200
committermbkma <[email protected]>2021-11-28 12:15:44 +0100
commit986b79874567caba035c125cd675edc89bea49c9 (patch)
treec241ee2b99030420b06e6c0ba113dea4c4c62ed9 /plugins
parentca9e5376cd6e395eaeb164b7ed633d400ff607c7 (diff)
downloadmate-settings-daemon-986b79874567caba035c125cd675edc89bea49c9.tar.bz2
mate-settings-daemon-986b79874567caba035c125cd675edc89bea49c9.tar.xz
datetime: fix memory leak
Diffstat (limited to 'plugins')
-rw-r--r--plugins/datetime/msd-datetime-mechanism.c6
1 files changed, 4 insertions, 2 deletions
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,