1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-12-24 17:41:01 +03:00

Fix unchecked allocation in test_suite_ssl

Signed-off-by: Andrzej Kurek <andrzej.kurek@arm.com>
This commit is contained in:
Andrzej Kurek
2022-10-12 09:27:44 -04:00
parent 110fc48070
commit 7ddb53c18d

View File

@@ -807,9 +807,9 @@ int mbedtls_endpoint_certificate_init( mbedtls_endpoint *ep, int pk_alg )
}
cert = &( ep->cert );
cert->ca_cert = mbedtls_calloc( 1, sizeof(mbedtls_x509_crt) );
cert->cert = mbedtls_calloc( 1, sizeof(mbedtls_x509_crt) );
cert->pkey = mbedtls_calloc( 1, sizeof(mbedtls_pk_context) );
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) );
mbedtls_x509_crt_init( cert->ca_cert );
mbedtls_x509_crt_init( cert->cert );