diff options
author | 2020-12-23 17:39:01 -0800 | |
---|---|---|
committer | 2022-04-30 13:34:21 +0200 | |
commit | cf2c7d48380969200034afeab93169e68c34c397 (patch) | |
tree | a96f518be279922d00898a3ce81dc0ff483a40b2 /src/mobileactivation.c | |
parent | 6cb13f9e6d3939930aecf91d8e23d1896a3b92e5 (diff) | |
download | libimobiledevice-cf2c7d48380969200034afeab93169e68c34c397.tar.gz libimobiledevice-cf2c7d48380969200034afeab93169e68c34c397.tar.bz2 |
[clang-tidy] Do not use else after return
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Diffstat (limited to 'src/mobileactivation.c')
-rw-r--r-- | src/mobileactivation.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/mobileactivation.c b/src/mobileactivation.c index 2de4333..79c7003 100644 --- a/src/mobileactivation.c +++ b/src/mobileactivation.c | |||
@@ -109,8 +109,6 @@ static plist_t plist_data_from_plist(plist_t plist) | |||
109 | 109 | ||
110 | static mobileactivation_error_t mobileactivation_check_result(plist_t dict, const char *command) | 110 | static mobileactivation_error_t mobileactivation_check_result(plist_t dict, const char *command) |
111 | { | 111 | { |
112 | mobileactivation_error_t ret = MOBILEACTIVATION_E_UNKNOWN_ERROR; | ||
113 | |||
114 | if (!dict || plist_get_node_type(dict) != PLIST_DICT) { | 112 | if (!dict || plist_get_node_type(dict) != PLIST_DICT) { |
115 | return MOBILEACTIVATION_E_PLIST_ERROR; | 113 | return MOBILEACTIVATION_E_PLIST_ERROR; |
116 | } | 114 | } |
@@ -118,14 +116,13 @@ static mobileactivation_error_t mobileactivation_check_result(plist_t dict, cons | |||
118 | plist_t err_node = plist_dict_get_item(dict, "Error"); | 116 | plist_t err_node = plist_dict_get_item(dict, "Error"); |
119 | if (!err_node) { | 117 | if (!err_node) { |
120 | return MOBILEACTIVATION_E_SUCCESS; | 118 | return MOBILEACTIVATION_E_SUCCESS; |
121 | } else { | ||
122 | char *errmsg = NULL; | ||
123 | plist_get_string_val(err_node, &errmsg); | ||
124 | debug_info("ERROR: %s: %s", command, errmsg); | ||
125 | ret = MOBILEACTIVATION_E_REQUEST_FAILED; | ||
126 | free(errmsg); | ||
127 | } | 119 | } |
128 | return ret; | 120 | |
121 | char *errmsg = NULL; | ||
122 | plist_get_string_val(err_node, &errmsg); | ||
123 | debug_info("ERROR: %s: %s", command, errmsg); | ||
124 | free(errmsg); | ||
125 | return MOBILEACTIVATION_E_REQUEST_FAILED; | ||
129 | } | 126 | } |
130 | 127 | ||
131 | static mobileactivation_error_t mobileactivation_send_command_plist(mobileactivation_client_t client, plist_t command, plist_t *result) | 128 | static mobileactivation_error_t mobileactivation_send_command_plist(mobileactivation_client_t client, plist_t command, plist_t *result) |