mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
The two const char* variables were pointing into QByteArray temporaries that were destroyed at the end of each declaration statement. By the time they were passed to udev, the memory was freed. Hold the QByteArrays in named locals so the data stays alive for the duration of the function. udev_device_new_from_syspath returns NULL if the syspath is invalid or the device disappears between enumeration and the privileged call. Add an early-return guard so the subsequent udev_device_set_sysattr_value call is never reached with a null device pointer. Also drop the unnecessary const_cast: udev_device_set_sysattr_value takes const char*, not char*. |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| flashlighthelper.actions | ||
| flashlighthelper.cpp | ||