summaryrefslogtreecommitdiffstats
path: root/tests/chip_wp.c
diff options
context:
space:
mode:
authorEdward O'Callaghan <quasisec@google.com>2023-01-15 14:50:25 +1100
committerAnastasia Klimchuk <aklm@chromium.org>2023-01-22 05:56:12 +0000
commitdd41980f1784c91dd8b30a9074a260621d366c2e (patch)
treea9a006d60a296cc3a92f4826348185aeff5b30ec /tests/chip_wp.c
parent46856234b3b6dea93e38c499eecbb432cb1e455e (diff)
downloadflashrom-dd41980f1784c91dd8b30a9074a260621d366c2e.tar.gz
flashrom-dd41980f1784c91dd8b30a9074a260621d366c2e.tar.bz2
flashrom-dd41980f1784c91dd8b30a9074a260621d366c2e.zip
tests/: Assert on NULL heap allocations in tests
Change-Id: Id2adcfe859fb25d2a7f0734655c6b9a58c0890b6 Signed-off-by: Edward O'Callaghan <quasisec@google.com> Reviewed-on: https://review.coreboot.org/c/flashrom/+/71919 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Anastasia Klimchuk <aklm@chromium.org>
Diffstat (limited to 'tests/chip_wp.c')
-rw-r--r--tests/chip_wp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/chip_wp.c b/tests/chip_wp.c
index f20b5001d..cb9b3ab40 100644
--- a/tests/chip_wp.c
+++ b/tests/chip_wp.c
@@ -269,6 +269,7 @@ void full_chip_erase_with_wp_dummyflasher_test_success(void **state)
* be optimized away. */
unsigned long size = flashrom_flash_getsize(&flash);
uint8_t *const contents = malloc(size);
+ assert_non_null(contents);
memset(contents, UNERASED_VALUE(&flash), size);
assert_int_equal(0, flashrom_image_write(&flash, contents, size, NULL));
free(contents);