Fixed memory leak when using transport:serial.
Fixed memory leak when using transport:serial. Code was previously
using strdup() to make a copy of the serial number which was not
necessary. Instead, just set serial=service.
Change-Id: Ifa8fe7999c6fb88955d2c6bdfcd3cd724ec1f020
Signed-off-by: Tom Marlin <tomm@bsquare.com>
diff --git a/adb/adb.c b/adb/adb.c
index f5e6e0c..a7d327b 100644
--- a/adb/adb.c
+++ b/adb/adb.c
@@ -1108,7 +1108,7 @@
type = kTransportAny;
} else if (!strncmp(service, "transport:", strlen("transport:"))) {
service += strlen("transport:");
- serial = strdup(service);
+ serial = service;
}
transport = acquire_one_transport(CS_ANY, type, serial, &error_string);