diff options
-rw-r--r-- | src/components/transport_manager/src/usb/libusb/usb_connection.cc | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/components/transport_manager/src/usb/libusb/usb_connection.cc b/src/components/transport_manager/src/usb/libusb/usb_connection.cc index 79ba5499d0..76f2f99e4c 100644 --- a/src/components/transport_manager/src/usb/libusb/usb_connection.cc +++ b/src/components/transport_manager/src/usb/libusb/usb_connection.cc @@ -200,9 +200,11 @@ void UsbConnection::OnOutTransfer(libusb_transfer* transfer) { DataSendError()); PopOutMessage(); } - libusb_free_transfer(transfer); - out_transfer_ = NULL; - waiting_out_transfer_cancel_ = false; + if (!current_out_message_.valid()) { + libusb_free_transfer(transfer); + out_transfer_ = NULL; + waiting_out_transfer_cancel_ = false; + } LOG4CXX_TRACE(logger_, "exit"); } |