Commit 88907321 authored by Marco Trevisan's avatar Marco Trevisan
Browse files

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.
parent 7dac81dc
......@@ -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);
}
......
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