tools:iio:iio_utils: fix allocation handling
authorHartmut Knaack <knaack.h@gmx.de>
Sun, 31 May 2015 12:39:45 +0000 (14:39 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2015 16:22:56 +0000 (17:22 +0100)
In build_channel_array(), count needs to be decreased in more places since
current->name and current->generic_name would be freed on the error path,
although they have not been allocated, yet.
This also requires to free current->name, when it is allocated, but
current->generic_name is not yet allocated.

Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/iio_utils.c

Simple merge