diff options
author | Nikias Bassen | 2013-03-14 03:09:14 +0100 |
---|---|---|
committer | Nikias Bassen | 2013-03-14 03:09:14 +0100 |
commit | 4222bc1b880d6535462e3b5ba5431809a3c5fddc (patch) | |
tree | b664bbdfe96d162930b2719ec920cd149684b0ed /src/heartbeat.c | |
parent | 23abc8303b8cad9251cd4ea4b5fa5af28e5f0b24 (diff) | |
download | libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.gz libimobiledevice-4222bc1b880d6535462e3b5ba5431809a3c5fddc.tar.bz2 |
global: make sure to check service before checking service->port to prevent crashes
Diffstat (limited to 'src/heartbeat.c')
-rw-r--r-- | src/heartbeat.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/heartbeat.c b/src/heartbeat.c index 0f8d2f3..cee852e 100644 --- a/src/heartbeat.c +++ b/src/heartbeat.c @@ -74,13 +74,13 @@ heartbeat_error_t heartbeat_client_new(idevice_t device, lockdownd_service_descr { *client = NULL; - debug_info("Creating heartbeat_client, port = %d.", service->port); - - if (!device || service->port == 0 || !client || *client) { + if (!device || !service || service->port == 0 || !client || *client) { debug_info("Incorrect parameter passed to heartbeat_client_new."); return HEARTBEAT_E_INVALID_ARG; } + debug_info("Creating heartbeat_client, port = %d.", service->port); + property_list_service_client_t plclient = NULL; heartbeat_error_t ret = heartbeat_error(property_list_service_client_new(device, service, &plclient)); if (ret != HEARTBEAT_E_SUCCESS) { |