diff options
author | rbuj <[email protected]> | 2021-10-21 16:15:39 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2022-07-09 21:00:24 +0200 |
commit | 0a7512040ff4e9e6354d8d519cd74dfb50fb7825 (patch) | |
tree | b4a0f84ffdb312a98b802b1ac2c0a2ba46ec8c67 | |
parent | 8a46d03e60e787adc6d3d2cb206b6c3edc066052 (diff) | |
download | mate-settings-daemon-0a7512040ff4e9e6354d8d519cd74dfb50fb7825.tar.bz2 mate-settings-daemon-0a7512040ff4e9e6354d8d519cd74dfb50fb7825.tar.xz |
datetime: fix memory leak
-rw-r--r-- | plugins/datetime/msd-datetime-mechanism.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/datetime/msd-datetime-mechanism.c b/plugins/datetime/msd-datetime-mechanism.c index 0a604f6..75a7615 100644 --- a/plugins/datetime/msd-datetime-mechanism.c +++ b/plugins/datetime/msd-datetime-mechanism.c @@ -228,7 +228,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; @@ -238,6 +238,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, @@ -587,7 +588,7 @@ check_can_do (MsdDatetimeMechanism *mechanism, const char *action, DBusGMethodInvocation *context) { - const char *sender; + char *sender; PolkitSubject *subject; PolkitAuthorizationResult *result; GError *error; @@ -595,6 +596,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, |