On Thu, Sep 8, 2022 at 4:03 PM Catalin Petrescu <catalin.petrescu@xxxxxxxxx> wrote: > > Hi there, > > I found a small error (IMHO) in libgpiod. > The issue is that asprintf may return -1 if it fails to allocate > memory, and if that happens, chip_open_by_number will pass a NULL > pointer to gpiod_chip_open. > > I hope this helps. > > Thanks, > > Catalin. Hey Catalin, Please next time send the patch inline using git's send-email command. You're right about the error code check but it should actually be ret < 0 as per asprintf's documentation. Bart