tools:iio: free channel-array completely

In iio_utils.c build_channel_array() dynamically allocates the string
generic_name in the current iio_channel_info, which doesn't got freed in
case of an error.
This dynamically allocated channel-array is used by generic_buffer, and
needs to be freed on the error/exit path.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
2 files changed