Fix the memory allocation in test_suite_ssl
ASSERT_ALLOC calculates the size itself, and the parameter indicates number of elements. ``` mbedtls_calloc( sizeof( *( pointer ) ), ( length ) ); ``` Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
parent
6454a90c6d
commit
a2a9688501
1 changed files with 3 additions and 3 deletions
|
@ -873,9 +873,9 @@ int mbedtls_endpoint_certificate_init( mbedtls_endpoint *ep, int pk_alg,
|
|||
}
|
||||
|
||||
cert = &( ep->cert );
|
||||
ASSERT_ALLOC( cert->ca_cert, sizeof(mbedtls_x509_crt) );
|
||||
ASSERT_ALLOC( cert->cert, sizeof(mbedtls_x509_crt) );
|
||||
ASSERT_ALLOC( cert->pkey, sizeof(mbedtls_pk_context) );
|
||||
ASSERT_ALLOC( cert->ca_cert, 1 );
|
||||
ASSERT_ALLOC( cert->cert, 1 );
|
||||
ASSERT_ALLOC( cert->pkey, 1 );
|
||||
|
||||
mbedtls_x509_crt_init( cert->ca_cert );
|
||||
mbedtls_x509_crt_init( cert->cert );
|
||||
|
|
Loading…
Reference in a new issue