tools:iio: catch errors in string allocation
This patch catches errors in string allocation in generic_buffer.c, iio_event_monitor.c, iio_utils.c and lsiio.c. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
parent
2156b17999
commit
e9e45b43b8
4 changed files with 24 additions and 6 deletions
|
@ -234,7 +234,9 @@ int main(int argc, char **argv)
|
|||
}
|
||||
printf("iio device number being used is %d\n", dev_num);
|
||||
|
||||
asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num);
|
||||
ret = asprintf(&dev_dir_name, "%siio:device%d", iio_dir, dev_num);
|
||||
if (ret < 0)
|
||||
return -ENOMEM;
|
||||
|
||||
if (!notrigger) {
|
||||
if (trigger_name == NULL) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue