diff options
author | Yabin Cui <yabinc@google.com> | 2015-09-30 22:10:51 +0200 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2015-09-30 22:10:51 +0200 |
commit | aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40 (patch) | |
tree | 7e3b4b63443cf43682fa1ced53520b0d3e46f11a | |
parent | am 2bdac629: Merge changes Ic769eafc,I63f28b3b (diff) | |
parent | Merge "minadbd: use strdup() to create argument for sideload thread." (diff) | |
download | android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar.gz android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar.bz2 android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar.lz android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar.xz android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.tar.zst android_bootable_recovery-aa59a9898824c39cad3f1a1dde5fc4c8ceeabb40.zip |
Diffstat (limited to '')
-rw-r--r-- | minadbd/services.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/minadbd/services.cpp b/minadbd/services.cpp index 2a3027bd8..d25648fb4 100644 --- a/minadbd/services.cpp +++ b/minadbd/services.cpp @@ -43,13 +43,14 @@ void* service_bootstrap_func(void* x) { } static void sideload_host_service(int sfd, void* data) { - const char* args = reinterpret_cast<const char*>(data); + char* args = reinterpret_cast<char*>(data); int file_size; int block_size; if (sscanf(args, "%d:%d", &file_size, &block_size) != 2) { printf("bad sideload-host arguments: %s\n", args); exit(1); } + free(args); printf("sideload-host file size %d block size %d\n", file_size, block_size); @@ -94,7 +95,8 @@ int service_to_fd(const char* name, const atransport* transport) { // sideload-host). exit(3); } else if (!strncmp(name, "sideload-host:", 14)) { - ret = create_service_thread(sideload_host_service, (void*)(name + 14)); + char* arg = strdup(name + 14); + ret = create_service_thread(sideload_host_service, arg); } if (ret >= 0) { close_on_exec(ret); |