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:
parent
a71bfb4a6a
commit
d3ccfc41f9
|
@ -220,7 +220,7 @@ int main(int argc, char **argv)
|
||||||
"%s-dev%d", device_name, dev_num);
|
"%s-dev%d", device_name, dev_num);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error_ret;
|
goto error_free_dev_dir_name;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,6 +354,8 @@ error_free_buf_dir_name:
|
||||||
error_free_triggername:
|
error_free_triggername:
|
||||||
if (datardytrigger)
|
if (datardytrigger)
|
||||||
free(trigger_name);
|
free(trigger_name);
|
||||||
|
error_free_dev_dir_name:
|
||||||
|
free(dev_dir_name);
|
||||||
error_ret:
|
error_ret:
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue