diff options
| -rw-r--r-- | src/client.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/client.c b/src/client.c index ba6a302..ed383b7 100644 --- a/src/client.c +++ b/src/client.c | |||
| @@ -213,7 +213,7 @@ static int send_result(struct mux_client *client, uint32_t tag, uint32_t result) | |||
| 213 | plist_dict_insert_item(dict, "MessageType", plist_new_string("Result")); | 213 | plist_dict_insert_item(dict, "MessageType", plist_new_string("Result")); |
| 214 | plist_dict_insert_item(dict, "Number", plist_new_uint(result)); | 214 | plist_dict_insert_item(dict, "Number", plist_new_uint(result)); |
| 215 | res = send_plist_pkt(client, tag, dict); | 215 | res = send_plist_pkt(client, tag, dict); |
| 216 | free(dict); | 216 | plist_free(dict); |
| 217 | } else { | 217 | } else { |
| 218 | /* binary packet */ | 218 | /* binary packet */ |
| 219 | res = send_pkt(client, tag, MESSAGE_RESULT, &result, sizeof(uint32_t)); | 219 | res = send_pkt(client, tag, MESSAGE_RESULT, &result, sizeof(uint32_t)); |
| @@ -482,6 +482,7 @@ static int client_command(struct mux_client *client, struct usbmuxd_header *hdr) | |||
| 482 | val = 0; | 482 | val = 0; |
| 483 | plist_get_uint_val(node, &val); | 483 | plist_get_uint_val(node, &val); |
| 484 | portnum = (uint16_t)val; | 484 | portnum = (uint16_t)val; |
| 485 | plist_free(dict); | ||
| 485 | 486 | ||
| 486 | usbmuxd_log(LL_DEBUG, "Client %d connection request to device %d port %d", client->fd, device_id, ntohs(portnum)); | 487 | usbmuxd_log(LL_DEBUG, "Client %d connection request to device %d port %d", client->fd, device_id, ntohs(portnum)); |
| 487 | res = device_start_connect(device_id, ntohs(portnum), client); | 488 | res = device_start_connect(device_id, ntohs(portnum), client); |
| @@ -495,10 +496,14 @@ static int client_command(struct mux_client *client, struct usbmuxd_header *hdr) | |||
| 495 | } | 496 | } |
| 496 | return 0; | 497 | return 0; |
| 497 | } else if (!strcmp(message, "ListDevices")) { | 498 | } else if (!strcmp(message, "ListDevices")) { |
| 499 | free(message); | ||
| 500 | plist_free(dict); | ||
| 498 | if (send_device_list(client, hdr->tag) < 0) | 501 | if (send_device_list(client, hdr->tag) < 0) |
| 499 | return -1; | 502 | return -1; |
| 500 | return 0; | 503 | return 0; |
| 501 | } else if (!strcmp(message, "ReadBUID")) { | 504 | } else if (!strcmp(message, "ReadBUID")) { |
| 505 | free(message); | ||
| 506 | plist_free(dict); | ||
| 502 | if (send_system_buid(client, hdr->tag) < 0) | 507 | if (send_system_buid(client, hdr->tag) < 0) |
| 503 | return -1; | 508 | return -1; |
| 504 | return 0; | 509 | return 0; |
