Memory leaks in weston-simple-im
There are memory leaks in clients/simple-im.c
. Using valgrind --leak-check=full
I get the following:
==31113== Memcheck, a memory error detector
==31113== Copyright (C) 2002-2022, and GNU GPL'd, by Julian Seward et al.
==31113== Using Valgrind-3.22.0 and LibVEX; rerun with -h for copyright info
==31113== Command: ./clients/weston-simple-im
==31113== Parent PID: 31112
==31113==
==31113==
==31113== HEAP SUMMARY:
==31113== in use at exit: 177,621 bytes in 1,865 blocks
==31113== total heap usage: 16,290 allocs, 14,425 frees, 762,183 bytes allocated
==31113==
==31113== 17,168 (376 direct, 16,792 indirect) bytes in 1 blocks are definitely lost in loss record 39 of 42
==31113== at 0x484A7BF: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31113== by 0x487E01E: wl_display_connect_to_fd (in /usr/lib64/libwayland-client.so.0.22.0)
==31113== by 0x487E29C: wl_display_connect (in /usr/lib64/libwayland-client.so.0.22.0)
==31113== by 0x402284: main (simple-im.c:492)
==31113==
==31113== 160,453 (136 direct, 160,317 indirect) bytes in 1 blocks are definitely lost in loss record 42 of 42
==31113== at 0x484A7BF: calloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==31113== by 0x48A4BB7: xkb_state_new (in /usr/lib64/libxkbcommon.so.0.0.0)
==31113== by 0x40198C: input_method_keyboard_keymap (simple-im.c:206)
==31113== by 0x4AD8961: ??? (in /usr/lib64/libffi.so.8.1.2)
==31113== by 0x4AD52DE: ??? (in /usr/lib64/libffi.so.8.1.2)
==31113== by 0x4AD7F25: ffi_call (in /usr/lib64/libffi.so.8.1.2)
==31113== by 0x487AA22: ??? (in /usr/lib64/libwayland-client.so.0.22.0)
==31113== by 0x487B202: ??? (in /usr/lib64/libwayland-client.so.0.22.0)
==31113== by 0x487B493: wl_display_dispatch_queue_pending (in /usr/lib64/libwayland-client.so.0.22.0)
==31113== by 0x40238A: main (simple-im.c:518)
==31113==
==31113== LEAK SUMMARY:
==31113== definitely lost: 512 bytes in 2 blocks
==31113== indirectly lost: 177,109 bytes in 1,863 blocks
==31113== possibly lost: 0 bytes in 0 blocks
==31113== still reachable: 0 bytes in 0 blocks
==31113== suppressed: 0 bytes in 0 blocks
==31113==
==31113== For lists of detected and suppressed errors, rerun with: -s
==31113== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)