aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Mykyta Holubakha <hilobakho@gmail.com>2017-07-01 20:21:12 +0300
committerLibravatar Mykyta Holubakha <hilobakho@gmail.com>2017-07-01 21:35:53 +0300
commit4f905ecb9636561d91bc9b33919cd390bdcbc432 (patch)
tree6bbe278e04a524795e7e439c1454dd12e18336e9 /sway
parentAdd the 'clipboard' command to set the clipboard (diff)
downloadsway-4f905ecb9636561d91bc9b33919cd390bdcbc432.tar.gz
sway-4f905ecb9636561d91bc9b33919cd390bdcbc432.tar.zst
sway-4f905ecb9636561d91bc9b33919cd390bdcbc432.zip
permit.c: check for NULL pointer dereference
Diffstat (limited to 'sway')
-rw-r--r--sway/commands/permit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sway/commands/permit.c b/sway/commands/permit.c
index 66fa4e2a..7a5e06f7 100644
--- a/sway/commands/permit.c
+++ b/sway/commands/permit.c
@@ -65,11 +65,11 @@ struct cmd_results *cmd_permit(int argc, char **argv) {
65 } 65 }
66 66
67 struct feature_policy *policy = get_feature_policy(program); 67 struct feature_policy *policy = get_feature_policy(program);
68 if (assign_perms) { 68 if (policy && assign_perms) {
69 policy->features |= get_features(argc, argv, &error); 69 policy->features |= get_features(argc, argv, &error);
70 sway_log(L_DEBUG, "Permissions granted to %s for features %d",
71 policy->program, policy->features);
70 } 72 }
71 sway_log(L_DEBUG, "Permissions granted to %s for features %d",
72 policy->program, policy->features);
73 73
74 free(program); 74 free(program);
75 return cmd_results_new(CMD_SUCCESS, NULL, NULL); 75 return cmd_results_new(CMD_SUCCESS, NULL, NULL);