Handle allocation failures in security code

Note that such errors are generally going to be fatal
This commit is contained in:
Drew DeVault 2016-12-15 18:10:29 -05:00
parent 31b002b6d5
commit 7784f1a905
3 changed files with 24 additions and 2 deletions

View file

@ -50,6 +50,9 @@ static struct feature_policy *get_policy(const char *name) {
}
if (!policy) {
policy = alloc_feature_policy(name);
if (!policy) {
sway_abort("Unable to allocate security policy");
}
list_add(config->feature_policies, policy);
}
return policy;