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:
Bastien Nocera 2018-12-12 16:06:03 +01:00
parent 25d0fa42e2
commit 6845e400cd

View file

@ -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: