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:
parent
4da52f78f6
commit
43cf28b9da
1 changed files with 3 additions and 3 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue