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: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Hartmut Knaack 2015-05-31 14:39:41 +02:00 committed by Jonathan Cameron
parent 884ca45613
commit a71bfb4a6a
1 changed files with 2 additions and 2 deletions

View File

@ -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: