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

tools:iio:generic_buffer: fix order of freeing data

data gets allocated before buffer_access, so it should be freed in reverse
order. Otherwise, if allocating buffer_access fails, an attempt to free it
would be taken, which should not happen.
Signed-off-by: default avatarHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: default avatarJonathan Cameron <jic23@kernel.org>
parent 884ca456
......@@ -345,10 +345,10 @@ int main(int argc, char **argv)
error_close_buffer_access:
close(fp);
error_free_data:
free(data);
error_free_buffer_access:
free(buffer_access);
error_free_data:
free(data);
error_free_buf_dir_name:
free(buf_dir_name);
error_free_triggername:
......
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