device: Always free error in delete enrolled fingers2

During delete enrolled fingers2 call, if the check-claimed control fails, 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 the other manual free call, and use an auto-pointer instead for this
function.
This commit is contained in:
Marco Trevisan (Treviño)
2020-02-04 19:47:56 +01:00
parent 49dced5566
commit ba7a45d3f8

View File

@ -1407,7 +1407,7 @@ static void fprint_device_delete_enrolled_fingers2(FprintDevice *rdev,
DBusGMethodInvocation *context)
{
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
GError *error = NULL;
g_autoptr(GError) error = NULL;
if (_fprint_device_check_claimed(rdev, context, &error) == FALSE) {
dbus_g_method_return_error (context, error);
@ -1416,7 +1416,6 @@ static void fprint_device_delete_enrolled_fingers2(FprintDevice *rdev,
if (_fprint_device_check_polkit_for_action (rdev, context, "net.reactivated.fprint.device.enroll", &error) == FALSE) {
dbus_g_method_return_error (context, error);
g_error_free (error);
return;
}