tools: iio: Set caller's ci_array pointer to NULL after free
authorJoo Aun Saw <jasaw@dius.com.au>
Fri, 24 Jul 2015 15:23:28 +0000 (01:23 +1000)
committerJonathan Cameron <jic23@kernel.org>
Sat, 8 Aug 2015 18:51:39 +0000 (19:51 +0100)
commit6b20f40679108e3c04e9bdb3d719e364ec29289e
tree7559c86e74bccf6b8121cbe604f187e3bcd784da
parentbdb25b0af8bd225ddf82083d767fada56fb2c1ae
tools: iio: Set caller's ci_array pointer to NULL after free

On error, caller's ci_array is freed and set to NULL to avoid
potential double free if some other user of this code is not
sufficiently careful. Counter is reset to zero for consistency.

Signed-off-by: Joo Aun Saw <jasaw@dius.com.au>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
tools/iio/iio_utils.c