diff options
author | Mykyta Holubakha <hilobakho@gmail.com> | 2017-07-01 20:30:38 +0300 |
---|---|---|
committer | Mykyta Holubakha <hilobakho@gmail.com> | 2017-07-01 21:36:17 +0300 |
commit | 7d8a84b58790454308bcac114d3f28a09c28928c (patch) | |
tree | af35993f88080f41b9e2dddb69a20d5152a088ed /sway/security.c | |
parent | permit.c: check for NULL pointer dereference (diff) | |
download | sway-7d8a84b58790454308bcac114d3f28a09c28928c.tar.gz sway-7d8a84b58790454308bcac114d3f28a09c28928c.tar.zst sway-7d8a84b58790454308bcac114d3f28a09c28928c.zip |
Do not add empty policies
Policy allocation failure is non-fatal
Diffstat (limited to 'sway/security.c')
-rw-r--r-- | sway/security.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/security.c b/sway/security.c index 92de06c1..fcd70f9d 100644 --- a/sway/security.c +++ b/sway/security.c | |||
@@ -152,10 +152,10 @@ struct feature_policy *get_feature_policy(const char *name) { | |||
152 | } | 152 | } |
153 | if (!policy) { | 153 | if (!policy) { |
154 | policy = alloc_feature_policy(name); | 154 | policy = alloc_feature_policy(name); |
155 | if (!policy) { | 155 | sway_assert(policy, "Unable to allocate security policy"); |
156 | sway_abort("Unable to allocate security policy"); | 156 | if (policy) { |
157 | list_add(config->feature_policies, policy); | ||
157 | } | 158 | } |
158 | list_add(config->feature_policies, policy); | ||
159 | } | 159 | } |
160 | return policy; | 160 | return policy; |
161 | } | 161 | } |