iter: fix a crash occurring if no GPIO chips are present
iter: fix a crash occurring if no GPIO chips are present

If no GPIO chips are present in the system, we bail out from
gpiod_chip_iter_new() before allocating the chips array. Add a check
in gpiod_chip_iter_free() to avoid calling free() for iter->chips in
that case.

Signed-off-by: Bartosz Golaszewski <108de5fbc428215dc26df4468b48691526611148@gmail.com>

brgl/libgpiod,brgl/libgpiod,brgl/libgpiod,brgl/libgpiod