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:

committed by
Jonathan Cameron

parent
2156b17999
commit
e9e45b43b8
@@ -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);
|
||||
|
Reference in New Issue
Block a user