summaryrefslogtreecommitdiffstats
path: root/src/lockdown.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lockdown.c')
-rw-r--r--src/lockdown.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/lockdown.c b/src/lockdown.c
index 25e8c87..d0922dd 100644
--- a/src/lockdown.c
+++ b/src/lockdown.c
@@ -163,22 +163,22 @@ lockdownd_error_t lockdown_check_result(plist_t dict, const char *query_match)
163 163
164 if (plist_get_node_type(query_node) != PLIST_STRING) { 164 if (plist_get_node_type(query_node) != PLIST_STRING) {
165 return ret; 165 return ret;
166 } else { 166 }
167 char *query_value = NULL;
168 167
169 plist_get_string_val(query_node, &query_value); 168 char *query_value = NULL;
170 if (!query_value) {
171 return ret;
172 }
173 169
174 if (query_match && (strcmp(query_value, query_match) != 0)) { 170 plist_get_string_val(query_node, &query_value);
175 free(query_value); 171 if (!query_value) {
176 return ret; 172 return ret;
177 } 173 }
178 174
175 if (query_match && (strcmp(query_value, query_match) != 0)) {
179 free(query_value); 176 free(query_value);
177 return ret;
180 } 178 }
181 179
180 free(query_value);
181
182 plist_t result_node = plist_dict_get_item(dict, "Result"); 182 plist_t result_node = plist_dict_get_item(dict, "Result");
183 if (!result_node) { 183 if (!result_node) {
184 /* iOS 5: the 'Result' key is not present anymore. 184 /* iOS 5: the 'Result' key is not present anymore.