diff options
author | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2021-01-28 02:27:40 +0100 |
---|---|---|
committer | Marco Trevisan (Treviño) <mail@3v1n0.net> | 2021-01-28 15:39:48 +0100 |
commit | 43cf28b9dafae9c220232ae3000755663a31fbf7 (patch) | |
tree | eee719975514c5509220b7045e7452095069fa71 | |
parent | 4da52f78f67b120527bae6124680d2629b14c7be (diff) |
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.
-rw-r--r-- | libfprint/fp-device.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libfprint/fp-device.c b/libfprint/fp-device.c index a5973e8..fedaa33 100644 --- a/libfprint/fp-device.c +++ b/libfprint/fp-device.c @@ -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); } |