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>
This commit is contained in:
Hartmut Knaack 2015-05-31 14:39:42 +02:00 committed by Jonathan Cameron
parent a71bfb4a6a
commit d3ccfc41f9

View File

@ -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;
}