mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-09 04:13:33 +02:00
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 function.
This commit is contained in:
@ -1349,7 +1349,7 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
|||||||
DBusGMethodInvocation *context)
|
DBusGMethodInvocation *context)
|
||||||
{
|
{
|
||||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
||||||
GError *error = NULL;
|
g_autoptr(GError) error = NULL;
|
||||||
char *user, *sender;
|
char *user, *sender;
|
||||||
gboolean opened;
|
gboolean opened;
|
||||||
|
|
||||||
@ -1365,14 +1365,12 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
|||||||
&error);
|
&error);
|
||||||
if (user == NULL) {
|
if (user == NULL) {
|
||||||
dbus_g_method_return_error (context, error);
|
dbus_g_method_return_error (context, error);
|
||||||
g_error_free (error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_fprint_device_check_polkit_for_action (rdev, context, "net.reactivated.fprint.device.enroll", &error) == FALSE) {
|
if (_fprint_device_check_polkit_for_action (rdev, context, "net.reactivated.fprint.device.enroll", &error) == FALSE) {
|
||||||
g_free (user);
|
g_free (user);
|
||||||
dbus_g_method_return_error (context, error);
|
dbus_g_method_return_error (context, error);
|
||||||
g_error_free (error);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1383,7 +1381,6 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
g_clear_error (&error);
|
|
||||||
opened = FALSE;
|
opened = FALSE;
|
||||||
} else {
|
} else {
|
||||||
opened = TRUE;
|
opened = TRUE;
|
||||||
|
|||||||
Reference in New Issue
Block a user