Fix usage of ASSERT_ALLOC()

The second argument is the number of elements of the type the first
argument is pointing to, so we shouldn't be using sizeof there.

This was resulting in overly large allocations.

Signed-off-by: Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com>
This commit is contained in:
Manuel Pégourié-Gonnard 2022-10-14 09:35:55 +02:00
parent 279188f3f3
commit d44d3eaa8d

View File

@ -779,7 +779,7 @@ void free_named_data_list( int length )
for( i = 0; i < length; i++ )
{
mbedtls_asn1_named_data *new = NULL;
ASSERT_ALLOC( new, sizeof( mbedtls_asn1_named_data ) );
ASSERT_ALLOC( new, 1 );
new->next = head;
head = new;
}