diff options
| author | 2010-05-28 12:15:58 +0200 | |
|---|---|---|
| committer | 2010-05-28 12:15:58 +0200 | |
| commit | c55851cb0b0a7678aac290594f55fcf7dab09689 (patch) | |
| tree | 471b045c3a2e0ddd60a47f9c3f4b0361f7e516f0 /src/lockdown.c | |
| parent | b2c56d67d0dda2bf7624c27dc3714fa8e323bcf7 (diff) | |
| download | libimobiledevice-c55851cb0b0a7678aac290594f55fcf7dab09689.tar.gz libimobiledevice-c55851cb0b0a7678aac290594f55fcf7dab09689.tar.bz2 | |
Refactor lockdownd_client_new() internals
Diffstat (limited to 'src/lockdown.c')
| -rw-r--r-- | src/lockdown.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/src/lockdown.c b/src/lockdown.c index 6de63b9..d91a066 100644 --- a/src/lockdown.c +++ b/src/lockdown.c | |||
| @@ -617,8 +617,6 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli | |||
| 617 | if (!client) | 617 | if (!client) |
| 618 | return LOCKDOWN_E_INVALID_ARG; | 618 | return LOCKDOWN_E_INVALID_ARG; |
| 619 | 619 | ||
| 620 | lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; | ||
| 621 | |||
| 622 | property_list_service_client_t plistclient = NULL; | 620 | property_list_service_client_t plistclient = NULL; |
| 623 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { | 621 | if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { |
| 624 | debug_info("could not connect to lockdownd (device %s)", device->uuid); | 622 | debug_info("could not connect to lockdownd (device %s)", device->uuid); |
| @@ -630,17 +628,11 @@ lockdownd_error_t lockdownd_client_new(idevice_t device, lockdownd_client_t *cli | |||
| 630 | client_loc->ssl_enabled = 0; | 628 | client_loc->ssl_enabled = 0; |
| 631 | client_loc->session_id = NULL; | 629 | client_loc->session_id = NULL; |
| 632 | client_loc->uuid = NULL; | 630 | client_loc->uuid = NULL; |
| 633 | client_loc->label = NULL; | 631 | client_loc->label = label ? strdup(label) : NULL; |
| 634 | if (label != NULL) | ||
| 635 | client_loc->label = strdup(label); | ||
| 636 | 632 | ||
| 637 | if (LOCKDOWN_E_SUCCESS == ret) { | 633 | *client = client_loc; |
| 638 | *client = client_loc; | ||
| 639 | } else { | ||
| 640 | lockdownd_client_free(client_loc); | ||
| 641 | } | ||
| 642 | 634 | ||
| 643 | return ret; | 635 | return LOCKDOWN_E_SUCCESS; |
| 644 | } | 636 | } |
| 645 | 637 | ||
| 646 | /** | 638 | /** |
