diff options
author | Nikias Bassen | 2023-06-21 00:12:04 +0200 |
---|---|---|
committer | Nikias Bassen | 2023-06-21 00:12:04 +0200 |
commit | 8d30a559cf0585625d9d05dc8ce0dd495b1de4f4 (patch) | |
tree | 6881d4a423f37f982416ea347e082a51f12a96ff /src/libusbmuxd.c | |
parent | f47c36f5bd2a653a3bd7fb1cf1d2c50b0e6193fb (diff) | |
download | libusbmuxd-8d30a559cf0585625d9d05dc8ce0dd495b1de4f4.tar.gz libusbmuxd-8d30a559cf0585625d9d05dc8ce0dd495b1de4f4.tar.bz2 |
Remove unneeded buffer copy in device_info_from_plist()
Diffstat (limited to 'src/libusbmuxd.c')
-rw-r--r-- | src/libusbmuxd.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libusbmuxd.c b/src/libusbmuxd.c index cfb34a2..95e322f 100644 --- a/src/libusbmuxd.c +++ b/src/libusbmuxd.c @@ -282,13 +282,11 @@ static usbmuxd_device_info_t *device_info_from_plist(plist_t props) devinfo->conn_type = CONNECTION_TYPE_NETWORK; n = plist_dict_get_item(props, "NetworkAddress"); if (n && plist_get_node_type(n) == PLIST_DATA) { - char *netaddr = NULL; uint64_t addr_len = 0; - plist_get_data_val(n, &netaddr, &addr_len); + const char *netaddr = plist_get_data_ptr(n, &addr_len); if (netaddr && addr_len > 0 && addr_len < sizeof(devinfo->conn_data)) { memcpy(devinfo->conn_data, netaddr, addr_len); } - free(netaddr); } } else { LIBUSBMUXD_ERROR("%s: Unexpected ConnectionType '%s'\n", __func__, strval); |