On Fri, Aug 11, 2023 at 02:26:55AM +0100, andy pugh wrote: > On Fri, 11 Aug 2023 at 01:59, Kent Gibson <warthog618@xxxxxxxxx> wrote: > > > So you don't need to alloc for it at all - gpiod_line_find() already did > > that. As per that function's comment, you still need to close the chip > > eventually to prevent memory leaks. > > Close then free? > gpiod_chip_close() does both the close of the file descriptor and the free of the allocated struct. Cheers, Kent.