]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commitdiff
tools:iio:iio_utils: free scan_el_dir on exit
authorHartmut Knaack <knaack.h@gmx.de>
Sun, 31 May 2015 12:39:43 +0000 (14:39 +0200)
committerJonathan Cameron <jic23@kernel.org>
Sun, 31 May 2015 16:19:12 +0000 (17:19 +0100)
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>
tools/iio/iio_utils.c

index 6f6452167b670a833ecc50b6eb136743a9fafd05..f879ad7b88bc8b28bd7e72686969728913ab9555 100644 (file)
@@ -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);