Commit 6845e400 authored by Bastien Nocera's avatar Bastien Nocera

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");
                ^~~~~~
parent 25d0fa42
...@@ -1348,6 +1348,8 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data) ...@@ -1348,6 +1348,8 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
} }
urudev = g_malloc0(sizeof(*urudev)); urudev = g_malloc0(sizeof(*urudev));
fp_dev_set_instance_data(FP_DEV(dev), urudev);
urudev->profile = &uru4k_dev_info[driver_data]; urudev->profile = &uru4k_dev_info[driver_data];
urudev->interface = iface_desc->bInterfaceNumber; urudev->interface = iface_desc->bInterfaceNumber;
...@@ -1374,7 +1376,6 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data) ...@@ -1374,7 +1376,6 @@ static int dev_init(struct fp_img_dev *dev, unsigned long driver_data)
} }
urudev->param = PK11_ParamFromIV(urudev->cipher, NULL); urudev->param = PK11_ParamFromIV(urudev->cipher, NULL);
fp_dev_set_instance_data(FP_DEV(dev), urudev);
fpi_imgdev_open_complete(dev, 0); fpi_imgdev_open_complete(dev, 0);
out: out:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment