mirror of
https://github.com/RPCS3/libusb.git
synced 2026-07-19 12:54:36 -04:00
b4c9b4272d
The CALL_CHECK macro returns from the current function, so in the test_device() function the device handle was being leaked when one of the functions failed. This commit adds a new CALL_CHECK_CLOSE macro that does the same as CALL_CHECK but also closes the device handle before returning. In addition, the macros are changed to declare their needed variable rather than relying on the variable to already exist within the scope of the function. Signed-off-by: Chris Dickens <christopher.a.dickens@gmail.com>