utilfdt_read_err: use xmalloc funcs
We've got these handy helpers, so let's use them. Acked-by: David Gibson <David@gibson.dropbear.id.au> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
This commit is contained in:
parent
27cdc1b16f
commit
f8cb5dd949
1 changed files with 2 additions and 2 deletions
4
util.c
4
util.c
|
@ -212,12 +212,12 @@ int utilfdt_read_err(const char *filename, char **buffp)
|
|||
}
|
||||
|
||||
/* Loop until we have read everything */
|
||||
buf = malloc(bufsize);
|
||||
buf = xmalloc(bufsize);
|
||||
do {
|
||||
/* Expand the buffer to hold the next chunk */
|
||||
if (offset == bufsize) {
|
||||
bufsize *= 2;
|
||||
buf = realloc(buf, bufsize);
|
||||
buf = xrealloc(buf, bufsize);
|
||||
if (!buf) {
|
||||
ret = ENOMEM;
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue