mirror of
https://gitlab.com/mishakmak/pam-fprint-grosshack.git
synced 2026-04-08 20:03:34 +02:00
device: Don't leak the user on claim error while deleting prints
When using the delete method we check if the device was claimed, if this fails because the device is already in use we return an error, but we don't free the user. While this could be fixed by just a further g_free call, let's just remove remove the other manual free calls, and use an auto-pointer instead for this function.
This commit is contained in:
@ -1349,7 +1349,8 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
||||
{
|
||||
FprintDevicePrivate *priv = fprint_device_get_instance_private(rdev);
|
||||
g_autoptr(GError) error = NULL;
|
||||
char *user, *sender;
|
||||
g_autofree char *user = NULL;
|
||||
char *sender;
|
||||
gboolean opened;
|
||||
|
||||
g_warning ("The API user should be updated to use DeleteEnrolledFingers2 method!");
|
||||
@ -1368,7 +1369,6 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
||||
}
|
||||
|
||||
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);
|
||||
return;
|
||||
}
|
||||
@ -1397,8 +1397,6 @@ static void fprint_device_delete_enrolled_fingers(FprintDevice *rdev,
|
||||
if (!opened && fp_device_has_storage (priv->dev))
|
||||
fp_device_close_sync (priv->dev, NULL, NULL);
|
||||
|
||||
g_free (user);
|
||||
|
||||
dbus_g_method_return(context);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user