From: Hartmut Knaack <knaack.h@gmx.de>
Date: Sun, 31 May 2015 12:39:43 +0000 (+0200)
Subject: tools:iio:iio_utils: free scan_el_dir on exit
X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=66dd08fde06e5ad6f0f86c7a780d60973e9d9cf0;p=linux.git

tools:iio:iio_utils: free scan_el_dir on exit

In the error path, the string scan_el_dir got freed, while it was missing when
build_channel_array() finished without errors.

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

diff --git a/tools/iio/iio_utils.c b/tools/iio/iio_utils.c
index 6f6452167b670..f879ad7b88bc8 100644
--- a/tools/iio/iio_utils.c
+++ b/tools/iio/iio_utils.c
@@ -403,6 +403,7 @@ int build_channel_array(const char *device_dir,
 	}
 
 	closedir(dp);
+	free(scan_el_dir);
 	/* reorder so that the array is in index order */
 	bsort_channel_array_by_index(ci_array, *counter);