WinCE: ref result of usbi_get_device_by_session_id()

After the "WinCE: Fix device reference leak which caused crash on
libusb_exit()" commit, the code always unref-s dev after adding it to
discovered_devs. But if dev comes from usbi_get_device_by_session_id()
it is a weak ref and as such should not be unreffed.

Instead of re-adding comlicate ref tracking logic, this patch fixes this with
a libusb_device_ref(dev) of dev comes from usbi_get_device_by_session_id(),
turning the weak ref into a strong ref.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
2 files changed