From 8cef81d6f23adb66873ee5fd84aa7180b22624f2 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Thu, 15 Dec 2016 18:03:59 -0500 Subject: Handle some more memory allocation failures --- sway/commands.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'sway/commands.c') 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) { -- cgit v1.2.3