fastboot: Use copy constructor to copy fastboot match callback
Test: fastboot -s 15171FDF6000CV getvar all on OSX
Bug: 269348113
Change-Id: I968626c95ee19ea348bac48cac308e3c817e0d55
Signed-off-by: Dmitrii Merkurev <dimorinny@google.com>
diff --git a/fastboot/usb_osx.cpp b/fastboot/usb_osx.cpp
index a4b9307..5b9e5c8 100644
--- a/fastboot/usb_osx.cpp
+++ b/fastboot/usb_osx.cpp
@@ -456,8 +456,7 @@
}
if (h.success) {
- handle->reset(new usb_handle);
- memcpy(handle->get(), &h, sizeof(usb_handle));
+ handle->reset(new usb_handle(h));
ret = 0;
break;
}