mirror of
https://review.coreboot.org/flashrom.git
synced 2025-11-17 13:10:42 +01:00
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>
This commit is contained in:
committed by
Anastasia Klimchuk
parent
46856234b3
commit
dd41980f17
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user