Edward O'Callaghan has uploaded this change for review. ( https://review.coreboot.org/c/flashrom/+/69472 )
Change subject: tree/: Make heap alloc checks err msg consistent ......................................................................
tree/: Make heap alloc checks err msg consistent
Change-Id: Id84a9f15c33781efc494ed36a1c7cec82a0333d6 Signed-off-by: Edward O'Callaghan quasisec@google.com --- M flashrom.c M layout.c 2 files changed, 13 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/flashrom refs/changes/72/69472/1
diff --git a/flashrom.c b/flashrom.c index d842089..12ab525 100644 --- a/flashrom.c +++ b/flashrom.c @@ -452,7 +452,7 @@ const uint8_t erased_value = ERASED_VALUE(flash);
if (!cmpbuf) { - msg_gerr("Could not allocate memory!\n"); + msg_gerr("Out of memory!\n"); exit(1); } memset(cmpbuf, erased_value, len); @@ -511,7 +511,7 @@
uint8_t *readbuf = malloc(len); if (!readbuf) { - msg_gerr("Could not allocate memory!\n"); + msg_gerr("Out of memory!\n"); return -1; }
diff --git a/layout.c b/layout.c index be88428..2d18f83 100644 --- a/layout.c +++ b/layout.c @@ -145,7 +145,7 @@
tmp = malloc(sizeof(*tmp)); if (tmp == NULL) { - msg_gerr("Could not allocate memory"); + msg_gerr("Out of memory"); goto error; }