Commit 49dced55 authored by Marco Trevisan's avatar Marco Trevisan
Browse files

device: Always free error in delete enrolled fingers

During delete enrolled fingers call, if the check-claimed control fails, and
we get an error different from FPRINT_ERROR_CLAIM_DEVICE, we would return
the error without freeing it.

While this could be fixed by just a further g_error_free call, let's just
remove all the manual free calls, and use an auto-pointer instead for this
parent e25544a8
......@@ -1349,7 +1349,7 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
DBusGMethodInvocation *context)
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
GError *error = NULL;
g_autoptr(GError) error = NULL;
char *user, *sender;
gboolean opened;
......@@ -1365,14 +1365,12 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
if (user == NULL) {
dbus_g_method_return_error (context, error);
g_error_free (error);
if (_fprint_device_check_polkit_for_action (rdev, context, "net.reactivated.fprint.device.enroll", &error) == FALSE) {
g_free (user);
dbus_g_method_return_error (context, error);
g_error_free (error);
......@@ -1383,7 +1381,6 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
g_clear_error (&error);
opened = FALSE;
} else {
opened = TRUE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment