tools:iio: free channel-array completely
authorHartmut Knaack <knaack.h@gmx.de>
Sun, 31 May 2015 12:39:44 +0000 (14:39 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2015 16:20:16 +0000 (17:20 +0100)
commit63f05c855f3825b89b92cd21df0415e6e32af3dd
treed798e25a74fd44dad2c3311b88ffd42cd55d1bf8
parent66dd08fde06e5ad6f0f86c7a780d60973e9d9cf0
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>
tools/iio/generic_buffer.c
tools/iio/iio_utils.c