gpioinfo: Clean up scandir allocations
authorJoel Stanley <joel@jms.id.au>
Wed, 2 Feb 2022 12:01:23 +0000 (22:31 +1030)
committerBartosz Golaszewski <brgl@bgdev.pl>
Fri, 18 Feb 2022 18:37:13 +0000 (19:37 +0100)
commit7bd9e62fc29040ccad6a8363416c9dd0da0bc145
tree52ba4d42f5e53c872954cbfbf0e944b140a47adb
parenteea0d9df556718c3175002277b7f06322dfebaa6
gpioinfo: Clean up scandir allocations

==3017== 176 (80 direct, 96 indirect) bytes in 1 blocks are definitely lost in loss record 2 of 2
==3017==    at 0x483F6C7: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==3017==    by 0x491CE92: ??? (in /lib/libc.so.6)
==3017==    by 0x10AAAC: main (gpioinfo.c:215)

The entires must be freed, and then the array itself.

Signed-off-by: Joel Stanley <joel@jms.id.au>
Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
tools/gpioinfo.c