uru4000: Fix memory leak on error in dev_init()
libfprint/drivers/uru4000.c:1357:3: warning: Potential leak of memory pointed to by 'urudev' fp_err("could not get encryption slot"); ^~~~~~
This commit is contained in:
parent
25d0fa42e2
commit
6845e400cd
1 changed files with 2 additions and 1 deletions
|
@ -1348,6 +1348,8 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
|||
}
|
||||
|
||||
urudev = g_malloc0(sizeof(*urudev));
|
||||
fp_dev_set_instance_data(FP_DEV(dev), urudev);
|
||||
|
||||
urudev->profile = &uru4k_dev_info[driver_data];
|
||||
urudev->interface = iface_desc->bInterfaceNumber;
|
||||
|
||||
|
@ -1374,7 +1376,6 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
|
|||
}
|
||||
urudev->param = PK11_ParamFromIV(urudev->cipher, NULL);
|
||||
|
||||
fp_dev_set_instance_data(FP_DEV(dev), urudev);
|
||||
fpi_imgdev_open_complete(dev, 0);
|
||||
|
||||
out:
|
||||
|
|
Loading…
Reference in a new issue