mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
fp-device: Do not try to deference potentially NULL task data
In case we do an early error return in verify and identify calls we do not initialize the task data, but still in the finish functions we still try to use it. Avoid doing this, but just nullify the returned values.
This commit is contained in:
@@ -979,7 +979,7 @@ fp_device_verify_finish (FpDevice *device,
|
||||
|
||||
data = g_task_get_task_data (G_TASK (result));
|
||||
|
||||
*print = data->print;
|
||||
*print = data ? data->print : NULL;
|
||||
if (*print)
|
||||
g_object_ref (*print);
|
||||
}
|
||||
@@ -1092,13 +1092,13 @@ fp_device_identify_finish (FpDevice *device,
|
||||
|
||||
if (print)
|
||||
{
|
||||
*print = data->print;
|
||||
*print = data ? data->print : NULL;
|
||||
if (*print)
|
||||
g_object_ref (*print);
|
||||
}
|
||||
if (match)
|
||||
{
|
||||
*match = data->match;
|
||||
*match = data ? data->match : NULL;
|
||||
if (*match)
|
||||
g_object_ref (*match);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user