From dd41980f1784c91dd8b30a9074a260621d366c2e Mon Sep 17 00:00:00 2001 From: Edward O'Callaghan Date: Sun, 15 Jan 2023 14:50:25 +1100 Subject: tests/: Assert on NULL heap allocations in tests Change-Id: Id2adcfe859fb25d2a7f0734655c6b9a58c0890b6 Signed-off-by: Edward O'Callaghan Reviewed-on: https://review.coreboot.org/c/flashrom/+/71919 Tested-by: build bot (Jenkins) Reviewed-by: Anastasia Klimchuk --- tests/chip_wp.c | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/chip_wp.c') 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); -- cgit v1.2.3