tree/: Make heap alloc checks err msg consistent
Change-Id: Id84a9f15c33781efc494ed36a1c7cec82a0333d6
Signed-off-by: Edward O'Callaghan <quasisec@google.com>
Original-Reviewed-on: https://review.coreboot.org/c/flashrom/+/69472
Original-Reviewed-by: Felix Singer <felixsinger@posteo.net>
Reviewed-on: https://review.coreboot.org/c/flashrom-stable/+/71497
Reviewed-by: Nico Huber <nico.h@gmx.de>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
diff --git a/flashrom.c b/flashrom.c
index 87bb7b0..234f135 100644
--- a/flashrom.c
+++ b/flashrom.c
@@ -388,7 +388,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);
@@ -418,7 +418,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 231a962..a8d9a32 100644
--- a/layout.c
+++ b/layout.c
@@ -124,7 +124,7 @@
tmp = malloc(sizeof(*tmp));
if (tmp == NULL) {
- msg_gerr("Could not allocate memory");
+ msg_gerr("Out of memory");
return 1;
}