[sigrok-devel] [PATCH 2/4] testo: Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
The testo driver uses libusb_get_device_list() but neglects to call the matching libusb_device_list_free() on the error path. This will leak the memory allocated for the list as well as all the devices. To address the issue use sr_usb_open() instead of open-coding its functionality. sr_usb_open()

[sigrok-devel] [PATCH 1/4] lascar-el-usb: lascar_scan(): Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
lascar_scan() calls libusb_get_device_list() but never the matching libusb_free_device_list(). This will leak the memory allocated for the device list as well as all the devices. To fix this add the missing libusb_free_device_list(). While we are at it also make sure to handle errors returned by l

[sigrok-devel] [PATCH 3/4] victor-dmm: Fix USB device list leak

2016-05-06 Thread Lars-Peter Clausen
The victor-dmm driver uses libusb_get_device_list() but neglects to call the matching libusb_device_list_free(). This will leak the memory allocated for the list as well as all the devices. To address the issue use sr_usb_open() instead of open-coding its functionality. sr_usb_open() correctly han

[sigrok-devel] [PATCH 4/4] zeroplus-logic-cube: Fix USB device list

2016-05-06 Thread Lars-Peter Clausen
The testo driver uses libusb_get_device_list() but neglects to call the matching libusb_device_list_free() on the error path. This will leak the memory allocated for the list as well as all the devices. To address the issue use sr_usb_open() instead of open-coding its functionality. sr_usb_open()