Androiddump: Fix Result of 'malloc' is converted to a pointer of type 'unsigned short', which is incompatible with sizeof operand type 'unsigned short *'

Remove malloc

Change-Id: I12a7f76026336853a50bc5277404c44aa715b8d2
Reviewed-on: https://code.wireshark.org/review/7986
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
This commit is contained in:
Alexis La Goutte 2015-04-09 22:38:58 +02:00 committed by Michael Mann
parent 93169cb495
commit dc4345b4d1
1 changed files with 6 additions and 3 deletions

View File

@ -1968,6 +1968,9 @@ int main(int argc, char **argv) {
unsigned int logcat_text = 0;
const char *default_adb_server_ip = "127.0.0.1";
unsigned short default_adb_server_tcp_port = 5037;
unsigned short local_adb_server_tcp_port;
unsigned short local_bt_server_tcp_port;
unsigned short local_bt_local_tcp_port;
unsigned short *bt_server_tcp_port = NULL;
unsigned int bt_forward_socket = 0;
const char *bt_local_ip = NULL;
@ -2027,14 +2030,14 @@ int main(int argc, char **argv) {
adb_server_ip = strdup(optarg);
break;
case OPT_CONFIG_ADB_SERVER_TCP_PORT:
adb_server_tcp_port = (unsigned short *) malloc(sizeof(adb_server_tcp_port));
adb_server_tcp_port = &local_adb_server_tcp_port;
*adb_server_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
case OPT_CONFIG_LOGCAT_TEXT:
logcat_text = (strcmp(optarg, "TRUE") == 0);
break;
case OPT_CONFIG_BT_SERVER_TCP_PORT:
bt_server_tcp_port = (unsigned short *) malloc(sizeof(bt_server_tcp_port));
bt_server_tcp_port = &local_bt_server_tcp_port;
*bt_server_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
case OPT_CONFIG_BT_FORWARD_SOCKET:
@ -2044,7 +2047,7 @@ int main(int argc, char **argv) {
bt_local_ip = strdup(optarg);
break;
case OPT_CONFIG_BT_LOCAL_TCP_PORT:
bt_local_tcp_port = (unsigned short *) malloc(sizeof(bt_local_tcp_port));
bt_local_tcp_port = &local_bt_local_tcp_port;
*bt_local_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
default: