Make sure to free the FTDI device list and the FTDI context in scan_all()
otherwise memory leaks can be observed. Also make sure to free the FTDI
context in scan_device() on the error path.
Signed-off-by: Lars-Peter Clausen <redacted>
g_free(vendor);
g_free(model);
g_free(serial_num);
+ ftdi_free(devc->ftdic);
err_free_data_buf:
g_free(devc->data_buf);
g_free(devc);
curdev = curdev->next;
}
+ ftdi_list_free(&devlist);
+ ftdi_free(ftdic);
+
return devices;
err_free_ftdic: