Possible memory issues in libinput threading code
I've noticed this warning at build-time:
[34/227] Compiling C object unl0kr.p/lv_drivers_indev_libinput.c.o
../lv_drivers/indev/libinput.c: In function ‘read_pointer’:
../lv_drivers/indev/libinput.c:540:34: warning: ‘slot’ may be used uninitialized [-Wmaybe-uninitialized]
540 | state->slots[slot].pressed = evt->pressed;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~
../lv_drivers/indev/libinput.c:501:7: note: ‘slot’ was declared here
501 | int slot;
| ^~~~
As well as this possible memory leak reported by Valgrind.
==10459== 4,896 bytes in 17 blocks are possibly lost in loss record 440 of 479
==10459== at 0x484882C: calloc (vg_replace_malloc.c:1554)
==10459== by 0x4011412: UnknownInlinedFun (rtld-malloc.h:44)
==10459== by 0x4011412: allocate_dtv (dl-tls.c:375)
==10459== by 0x4011E11: _dl_allocate_tls (dl-tls.c:634)
==10459== by 0x49E2CFE: pthread_create@@GLIBC_2.34 (in /usr/lib64/libc.so.6)
==10459== by 0x408425: libinput_init_state (libinput.c:221)
==10459== by 0x4047FB: connect_devnode (indev.c:230)
==10459== by 0x404A0C: connect_udev_device (indev.c:188)
==10459== by 0x404B55: ul_indev_auto_connect (indev.c:450)
==10459== by 0x405503: main (main.c:438)
CC @calebccff.