summaryrefslogtreecommitdiffstats
path: root/tools/idevicebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/idevicebackup.c')
-rw-r--r--tools/idevicebackup.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/idevicebackup.c b/tools/idevicebackup.c
index 95c5694..8f5362c 100644
--- a/tools/idevicebackup.c
+++ b/tools/idevicebackup.c
@@ -755,7 +755,7 @@ static void do_post_notification(const char *notification)
}
lockdownd_start_service(client, NP_SERVICE_NAME, &service);
- if (service->port) {
+ if (service && service->port) {
np_client_new(device, service, &np);
if (np) {
np_post_notification(np, notification);
@@ -937,7 +937,7 @@ int main(int argc, char *argv[])
/* start notification_proxy */
np_client_t np = NULL;
ret = lockdownd_start_service(client, NP_SERVICE_NAME, &service);
- if ((ret == LOCKDOWN_E_SUCCESS) && service->port) {
+ if ((ret == LOCKDOWN_E_SUCCESS) && service && service->port) {
np_client_new(device, service, &np);
np_set_notify_callback(np, notify_cb, NULL);
const char *noties[5] = {
@@ -952,11 +952,6 @@ int main(int argc, char *argv[])
printf("ERROR: Could not start service %s.\n", NP_SERVICE_NAME);
}
- if (service) {
- lockdownd_service_descriptor_free(service);
- service = NULL;
- }
-
afc_client_t afc = NULL;
if (cmd == CMD_BACKUP) {
/* start AFC, we need this for the lock file */
@@ -975,7 +970,7 @@ int main(int argc, char *argv[])
/* start mobilebackup service and retrieve port */
ret = lockdownd_start_service(client, MOBILEBACKUP_SERVICE_NAME, &service);
- if ((ret == LOCKDOWN_E_SUCCESS) && service->port) {
+ if ((ret == LOCKDOWN_E_SUCCESS) && service && service->port) {
printf("Started \"%s\" service on port %d.\n", MOBILEBACKUP_SERVICE_NAME, service->port);
mobilebackup_client_new(device, service, &mobilebackup);