summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup2.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup2.c')
-rw-r--r--tools/idevicebackup2.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/idevicebackup2.c b/tools/idevicebackup2.c
index 0353c9b..d70a7ae 100644
--- a/tools/idevicebackup2.c
+++ b/tools/idevicebackup2.c
@@ -489,7 +489,7 @@ static void do_post_notification(idevice_t device, const char *notification)
489 } 489 }
490 490
491 lockdownd_start_service(lockdown, NP_SERVICE_NAME, &service); 491 lockdownd_start_service(lockdown, NP_SERVICE_NAME, &service);
492 if (service->port) { 492 if (service && service->port) {
493 np_client_new(device, service, &np); 493 np_client_new(device, service, &np);
494 if (np) { 494 if (np) {
495 np_post_notification(np, notification); 495 np_post_notification(np, notification);
@@ -1557,7 +1557,7 @@ int main(int argc, char *argv[])
1557 /* start notification_proxy */ 1557 /* start notification_proxy */
1558 np_client_t np = NULL; 1558 np_client_t np = NULL;
1559 ret = lockdownd_start_service(lockdown, NP_SERVICE_NAME, &service); 1559 ret = lockdownd_start_service(lockdown, NP_SERVICE_NAME, &service);
1560 if ((ret == LOCKDOWN_E_SUCCESS) && service->port) { 1560 if ((ret == LOCKDOWN_E_SUCCESS) && service && service->port) {
1561 np_client_new(device, service, &np); 1561 np_client_new(device, service, &np);
1562 np_set_notify_callback(np, notify_cb, NULL); 1562 np_set_notify_callback(np, notify_cb, NULL);
1563 const char *noties[5] = { 1563 const char *noties[5] = {
@@ -1572,11 +1572,6 @@ int main(int argc, char *argv[])
1572 printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME); 1572 printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME);
1573 } 1573 }
1574 1574
1575 if (service) {
1576 lockdownd_service_descriptor_free(service);
1577 service = NULL;
1578 }
1579
1580 afc_client_t afc = NULL; 1575 afc_client_t afc = NULL;
1581 if (cmd == CMD_BACKUP) { 1576 if (cmd == CMD_BACKUP) {
1582 /* start AFC, we need this for the lock file */ 1577 /* start AFC, we need this for the lock file */
@@ -1596,7 +1591,7 @@ int main(int argc, char *argv[])
1596 /* start mobilebackup service and retrieve port */ 1591 /* start mobilebackup service and retrieve port */
1597 mobilebackup2_client_t mobilebackup2 = NULL; 1592 mobilebackup2_client_t mobilebackup2 = NULL;
1598 ret = lockdownd_start_service(lockdown, MOBILEBACKUP2_SERVICE_NAME, &service); 1593 ret = lockdownd_start_service(lockdown, MOBILEBACKUP2_SERVICE_NAME, &service);
1599 if ((ret == LOCKDOWN_E_SUCCESS) && service->port) { 1594 if ((ret == LOCKDOWN_E_SUCCESS) && service && service->port) {
1600 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, service->port); 1595 PRINT_VERBOSE(1, "Started \"%s\" service on port %d.\n", MOBILEBACKUP2_SERVICE_NAME, service->port);
1601 mobilebackup2_client_new(device, service, &mobilebackup2); 1596 mobilebackup2_client_new(device, service, &mobilebackup2);
1602 1597