diff options
author | Martin Szulecki | 2010-05-28 12:15:58 +0200 |
---|---|---|
committer | Martin Szulecki | 2010-05-28 12:15:58 +0200 |
commit | c55851cb0b0a7678aac290594f55fcf7dab09689 (patch) | |
tree | 471b045c3a2e0ddd60a47f9c3f4b0361f7e516f0 | |
parent | b2c56d67d0dda2bf7624c27dc3714fa8e323bcf7 (diff) | |
download | libimobiledevice-c55851cb0b0a7678aac290594f55fcf7dab09689.tar.gz libimobiledevice-c55851cb0b0a7678aac290594f55fcf7dab09689.tar.bz2 |
Refactor lockdownd_client_new() internals
-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 if (!client) return LOCKDOWN_E_INVALID_ARG; - lockdownd_error_t ret = LOCKDOWN_E_SUCCESS; - property_list_service_client_t plistclient = NULL; if (property_list_service_client_new(device, 0xf27e, &plistclient) != PROPERTY_LIST_SERVICE_E_SUCCESS) { 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 client_loc->ssl_enabled = 0; client_loc->session_id = NULL; client_loc->uuid = NULL; - client_loc->label = NULL; - if (label != NULL) - client_loc->label = strdup(label); + client_loc->label = label ? strdup(label) : NULL; - if (LOCKDOWN_E_SUCCESS == ret) { - *client = client_loc; - } else { - lockdownd_client_free(client_loc); - } + *client = client_loc; - return ret; + return LOCKDOWN_E_SUCCESS; } /** |