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:
Hartmut Knaack
2015-05-31 14:40:02 +02:00
committed by Jonathan Cameron
parent 2156b17999
commit e9e45b43b8
4 changed files with 24 additions and 6 deletions

View File

@@ -265,6 +265,8 @@ int main(int argc, char **argv)
/* If we can't find a IIO device by name assume device_name is a
IIO chrdev */
chrdev_name = strdup(device_name);
if (!chrdev_name)
return -ENOMEM;
}
fd = open(chrdev_name, 0);