Browse Source

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>
main
Mike Frysinger 12 years ago committed by Jon Loeliger
parent
commit
f8cb5dd949
  1. 4
      util.c

4
util.c

@ -212,12 +212,12 @@ int utilfdt_read_err(const char *filename, char **buffp) @@ -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…
Cancel
Save