From 8fa3dcd5cd6f4841ae5e9789dde5c9daf302dd51 Mon Sep 17 00:00:00 2001 From: Christian Kellner Date: Tue, 14 Feb 2017 14:29:03 +0100 Subject: [PATCH] main: Plug tiny memory leak dbus_g_method_get_sender() returns an allocated-string which we need to free. This is handled properly in the rest of the codebase. https://bugs.freedesktop.org/show_bug.cgi?id=99811 --- src/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/device.c b/src/device.c index df26f3a..545ba95 100644 --- a/src/device.c +++ b/src/device.c @@ -402,7 +402,7 @@ static gboolean _fprint_device_check_polkit_for_action (FprintDevice *rdev, DBusGMethodInvocation *context, const char *action, GError **error) { FprintDevicePrivate *priv = DEVICE_GET_PRIVATE(rdev); - const char *sender; + char *sender; PolkitSubject *subject; PolkitAuthorizationResult *result; GError *_error = NULL; @@ -410,6 +410,7 @@ _fprint_device_check_polkit_for_action (FprintDevice *rdev, DBusGMethodInvocatio /* 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 (priv->auth, subject,