From 7784f1a905cad5ad805195dcc3cba23ff206501c Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 15 Dec 2016 18:10:29 -0500 Subject: Handle allocation failures in security code Note that such errors are generally going to be fatal --- sway/commands/permit.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sway/commands') diff --git a/sway/commands/permit.c b/sway/commands/permit.c index 7a25e4ce..dee246d7 100644 --- a/sway/commands/permit.c +++ b/sway/commands/permit.c @@ -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; -- cgit v1.2.3