Commit d3ccfc41 authored by Hartmut Knaack's avatar Hartmut Knaack Committed by Jonathan Cameron

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: default avatarHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent a71bfb4a
......@@ -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 @@ int main(int argc, char **argv)
error_free_triggername:
if (datardytrigger)
free(trigger_name);
error_free_dev_dir_name:
free(dev_dir_name);
error_ret:
return ret;
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment