Initialize server->serial in all cases
Running scrcpy --tcpip on a device already connected via TCP/IP did not initialize server->serial. As a consequence, in debug mode, an assertion failed: scrcpy: ../app/src/server.c:770: run_server: Assertion `server->serial' failed. In release mode, scrcpy failed with this error: adb: -s requires an argument
This commit is contained in:
parent
6b422e21bf
commit
3c3c07db05
1 changed files with 5 additions and 0 deletions
|
@ -689,6 +689,11 @@ sc_server_configure_tcpip_unknown_address(struct sc_server *server,
|
||||||
if (is_already_tcpip) {
|
if (is_already_tcpip) {
|
||||||
// Nothing to do
|
// Nothing to do
|
||||||
LOGI("Device already connected via TCP/IP: %s", serial);
|
LOGI("Device already connected via TCP/IP: %s", serial);
|
||||||
|
server->serial = strdup(serial);
|
||||||
|
if (!server->serial) {
|
||||||
|
LOG_OOM();
|
||||||
|
return false;
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue