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>
This commit is contained in:
Dmitrii Merkurev 2023-02-15 15:21:22 +00:00
parent d14a7551d5
commit b5b8276db1
1 changed files with 1 additions and 2 deletions

View File

@ -456,8 +456,7 @@ static int init_usb(ifc_match_func callback, std::unique_ptr<usb_handle>* handle
} }
if (h.success) { if (h.success) {
handle->reset(new usb_handle); handle->reset(new usb_handle(h));
memcpy(handle->get(), &h, sizeof(usb_handle));
ret = 0; ret = 0;
break; break;
} }