summaryrefslogtreecommitdiff
path: root/sway/commands.c
diff options
context:
space:
mode:
authorDrew DeVault <[email protected]>2016-12-15 18:03:59 -0500
committerDrew DeVault <[email protected]>2016-12-15 19:01:41 -0500
commit8cef81d6f23adb66873ee5fd84aa7180b22624f2 (patch)
tree0739dff1b879b5a674dbd56e44ad4f4a44e941c7 /sway/commands.c
parentd75a747a3ddc99f258025a923de1cf4821bf3115 (diff)
Handle some more memory allocation failures
Diffstat (limited to 'sway/commands.c')
-rw-r--r--sway/commands.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/sway/commands.c b/sway/commands.c
index dee03d71..8d199467 100644
--- a/sway/commands.c
+++ b/sway/commands.c
@@ -121,6 +121,9 @@ void input_cmd_apply(struct input_config *input) {
for (int i = 0; i < input_devices->length; ++i) {
device = input_devices->items[i];
char* dev_identifier = libinput_dev_unique_id(device);
+ if (!dev_identifier) {
+ break;
+ }
int match = dev_identifier && strcmp(dev_identifier, input->identifier) == 0;
free(dev_identifier);
if (match) {