diff options
-rw-r--r-- | darwin-bootstrap/bundle-loader.c | 4 | ||||
-rw-r--r-- | darwin-bootstrap/substituted.m | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/darwin-bootstrap/bundle-loader.c b/darwin-bootstrap/bundle-loader.c index 9006bf0..90ebbf2 100644 --- a/darwin-bootstrap/bundle-loader.c +++ b/darwin-bootstrap/bundle-loader.c @@ -98,7 +98,9 @@ enum bundle_test_result { static enum bundle_test_result do_bundle_test_type( xxpc_object_t info, const char *key, bool (*test)(const char *)) { xxpc_object_t values = xxpc_dictionary_get_value(info, key); - if (!values || xxpc_get_type(values) != XXPC_TYPE_ARRAY) + if (!values) + return BUNDLE_TEST_RESULT_EMPTY; + if (xxpc_get_type(values) != XXPC_TYPE_ARRAY) return BUNDLE_TEST_RESULT_INVALID; size_t count = xxpc_array_get_count(values); if (count == 0) diff --git a/darwin-bootstrap/substituted.m b/darwin-bootstrap/substituted.m index 8e7af7c..28576ea 100644 --- a/darwin-bootstrap/substituted.m +++ b/darwin-bootstrap/substituted.m @@ -142,18 +142,18 @@ static enum convert_filters_ret convert_filters(NSDictionary *plist_dict, for (int i = 0; i < 2; i++) { NSArray *things = [filter objectForKey:types[i].key]; - xxpc_object_t out_things = xxpc_array_create(NULL, 0); if (things) { if (![things isKindOfClass:[NSArray class]]) return INVALID; + xxpc_object_t out_things = xxpc_array_create(NULL, 0); for (NSString *name in things) { if (![name isKindOfClass:[NSString class]]) return INVALID; xxpc_array_append_value(out_things, nsstring_to_xpc(name)); } xxpc_dictionary_set_value(out_info, types[i].okey, out_things); + xxpc_release(out_things); } - xxpc_release(out_things); } return PROVISIONAL_PASS; |