diff --git a/modules/mbedtls/configs/config-tls-generic.h b/modules/mbedtls/configs/config-tls-generic.h index aff59f9e17e763..ddf7b3dddb3885 100644 --- a/modules/mbedtls/configs/config-tls-generic.h +++ b/modules/mbedtls/configs/config-tls-generic.h @@ -19,6 +19,14 @@ #define MBEDTLS_PLATFORM_EXIT_ALT #define MBEDTLS_NO_PLATFORM_ENTROPY +#if defined(CONFIG_MBEDTLS_ENABLE_HEAP) +/* Ensure that we're not using standard [m|c]alloc/free functions. + * mbedtls_memory_buffer_alloc_init() will set a local buffer to be used as + * heap and Mbed TLS will use internal function over it. + */ +#define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS +#endif + #if defined(CONFIG_MBEDTLS_ZEROIZE_ALT) #define MBEDTLS_PLATFORM_ZEROIZE_ALT #endif