diff --git a/src/libinput-plugin-lua.c b/src/libinput-plugin-lua.c index 2a09a64a..1036b3f0 100644 --- a/src/libinput-plugin-lua.c +++ b/src/libinput-plugin-lua.c @@ -168,7 +168,7 @@ lua_push_evdev_device(lua_State *L, lua_device->bustype = libinput_device_get_id_bustype(device); lua_device->vid = libinput_device_get_id_vendor(device); lua_device->pid = libinput_device_get_id_product(device); - lua_device->name = strdup(libinput_device_get_name(device)); + lua_device->name = safe_strdup(libinput_device_get_name(device)); lua_device->device_removed_refid = LUA_NOREF; lua_device->frame_refid = LUA_NOREF; list_init(&lua_device->udev_properties_list); diff --git a/src/libinput-plugin.c b/src/libinput-plugin.c index 766e85d0..a157669a 100644 --- a/src/libinput-plugin.c +++ b/src/libinput-plugin.c @@ -115,7 +115,7 @@ libinput_plugin_new(struct libinput *libinput, plugin->refcount = 1; plugin->interface = interface; plugin->user_data = user_data; - plugin->name = strdup(name); + plugin->name = safe_strdup(name); list_init(&plugin->timers); if (plugin->index >= 32) {