summaryrefslogtreecommitdiff
path: root/tools/iio
diff options
context:
space:
mode:
authorHartmut Knaack <knaack.h@gmx.de>2015-05-31 15:39:42 +0300
committerJonathan Cameron <jic23@kernel.org>2015-05-31 19:14:37 +0300
commitd3ccfc41f971105404694e8478b5e60625e46967 (patch)
treeab6cce091c5369e423210fb67134151f4dce5c26 /tools/iio
parenta71bfb4a6aabfe5e6f145883020153103c7fdfba (diff)
downloadlinux-d3ccfc41f971105404694e8478b5e60625e46967.tar.xz
tools:iio:generic_buffer: free dev_dir_name on exit
Make sure to free dev_dir_name in case of an error or regular exit. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
Diffstat (limited to 'tools/iio')
-rw-r--r--tools/iio/generic_buffer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tools/iio/generic_buffer.c b/tools/iio/generic_buffer.c
index 15f2a40c9bf7..7859ee9a46b2 100644
--- a/tools/iio/generic_buffer.c
+++ b/tools/iio/generic_buffer.c
@@ -220,7 +220,7 @@ int main(int argc, char **argv)
"%s-dev%d", device_name, dev_num);
if (ret < 0) {
ret = -ENOMEM;
- goto error_ret;
+ goto error_free_dev_dir_name;
}
}
@@ -354,6 +354,8 @@ error_free_buf_dir_name:
error_free_triggername:
if (datardytrigger)
free(trigger_name);
+error_free_dev_dir_name:
+ free(dev_dir_name);
error_ret:
return ret;
}