mirror of
https://github.com/swaywm/sway.git
synced 2026-04-06 07:15:44 -04:00
Handle some more memory allocation failures
This commit is contained in:
parent
d75a747a3d
commit
8cef81d6f2
5 changed files with 25 additions and 1 deletions
|
|
@ -45,6 +45,10 @@ char *libinput_dev_unique_id(struct libinput_device *device) {
|
|||
|
||||
int len = strlen(name) + sizeof(char) * 6;
|
||||
char *identifier = malloc(len);
|
||||
if (!identifier) {
|
||||
sway_log(L_ERROR, "Unable to allocate unique input device name");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
const char *fmt = "%d:%d:%s";
|
||||
snprintf(identifier, len, fmt, vendor, product, name);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue