summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/idevice.c6
-rw-r--r--src/idevice.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/idevice.c b/src/idevice.c
index f0d89df..c605da3 100644
--- a/src/idevice.c
+++ b/src/idevice.c
@@ -238,6 +238,7 @@ idevice_error_t idevice_connect(idevice_t device, uint16_t port, idevice_connect
new_connection->type = CONNECTION_USBMUXD;
new_connection->data = (void*)(long)sfd;
new_connection->ssl_data = NULL;
+ idevice_get_udid(device, &new_connection->udid);
*connection = new_connection;
return IDEVICE_E_SUCCESS;
} else {
@@ -270,7 +271,12 @@ idevice_error_t idevice_disconnect(idevice_connection_t connection)
} else {
debug_info("Unknown connection type %d", connection->type);
}
+
+ if (connection->udid)
+ free(connection->udid);
+
free(connection);
+
return result;
}
diff --git a/src/idevice.h b/src/idevice.h
index 4aeaf33..01b13df 100644
--- a/src/idevice.h
+++ b/src/idevice.h
@@ -58,6 +58,7 @@ struct ssl_data_private {
typedef struct ssl_data_private *ssl_data_t;
struct idevice_connection_private {
+ char *udid;
enum connection_type type;
void *data;
ssl_data_t ssl_data;