mirror of
https://gitlab.freedesktop.org/libfprint/libfprint.git
synced 2025-11-15 07:38:12 +00:00
goodix: Don't leak the templates array during verify
When verifying we initialize a temporary templates array but we never release it.
This commit is contained in:
committed by
Benjamin Berg
parent
91ee03eb7a
commit
989d498eb9
@@ -350,9 +350,9 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
gxfp_cmd_response_t *resp,
|
||||
GError *error)
|
||||
{
|
||||
g_autoptr(GPtrArray) templates = NULL;
|
||||
FpDevice *device = FP_DEVICE (self);
|
||||
FpPrint *print = NULL;
|
||||
GPtrArray *templates = NULL;
|
||||
gint cnt = 0;
|
||||
gboolean find = false;
|
||||
|
||||
@@ -365,15 +365,14 @@ fp_verify_cb (FpiDeviceGoodixMoc *self,
|
||||
{
|
||||
if (fpi_device_get_current_action (device) == FPI_DEVICE_ACTION_VERIFY)
|
||||
{
|
||||
|
||||
templates = g_ptr_array_new_with_free_func (g_object_unref);
|
||||
templates = g_ptr_array_sized_new (1);
|
||||
fpi_device_get_verify_data (device, &print);
|
||||
g_ptr_array_add (templates, g_object_ref_sink (print));
|
||||
|
||||
g_ptr_array_add (templates, print);
|
||||
}
|
||||
else
|
||||
{
|
||||
fpi_device_get_identify_data (device, &templates);
|
||||
g_ptr_array_ref (templates);
|
||||
}
|
||||
for (cnt = 0; cnt < templates->len; cnt++)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user