summaryrefslogtreecommitdiffstats
path: root/dev/afccheck.c
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2013-03-14 03:09:14 +0100
committerGravatar Nikias Bassen2013-03-14 03:09:14 +0100
commit4222bc1b880d6535462e3b5ba5431809a3c5fddc (patch)
treeb664bbdfe96d162930b2719ec920cd149684b0ed /dev/afccheck.c
parent23abc8303b8cad9251cd4ea4b5fa5af28e5f0b24 (diff)
downloadlibimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.gz
libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.bz2
global: make sure to check service before checking service->port to prevent crashes
Diffstat (limited to 'dev/afccheck.c')
-rw-r--r--dev/afccheck.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dev/afccheck.c b/dev/afccheck.c
index ead0ca0..d7ee7d1 100644
--- a/dev/afccheck.c
+++ b/dev/afccheck.c
@@ -111,7 +111,7 @@ int main(int argc, char *argv[])
return 1;
}
- if (LOCKDOWN_E_SUCCESS == lockdownd_start_service(client, "com.apple.afc", &service) && !service->port) {
+ if (LOCKDOWN_E_SUCCESS != lockdownd_start_service(client, "com.apple.afc", &service) || !service || !service->port) {
lockdownd_client_free(client);
idevice_free(phone);
fprintf(stderr, "Something went wrong when starting AFC.");