libfile: Error out if out of memory in read_file_2()
All other error cases in read_file_2() are handled gracefully, so
there shouldn't be any reason not do so for the case of trying to
allocate too much memory. This error path can be easily triggered
with:

barebox_update file-bigger-than-availible-ram.img

Currently this would result in a crash which is not really desirable
from user experience.

Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent e1818e0 commit 1e0d7e417acd745e5ddd9fb3b8dbb8691945f62f
@Andrey Smirnov Andrey Smirnov authored on 15 Oct 2018
Sascha Hauer committed on 16 Oct 2018
Showing 1 changed file
View
lib/libfile.c