From b48cdf846152746a4e177464bedfc41f500477ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20G=C3=B6ttgens?= Date: Wed, 16 Sep 2026 13:30:12 +0200 Subject: [PATCH] fix(http): probe through mbedtls_calloc so the calls keep C linkage --- src/mesh/http/WebServer.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/mesh/http/WebServer.cpp b/src/mesh/http/WebServer.cpp index 8644b55c8..d8a7d64f8 100644 --- a/src/mesh/http/WebServer.cpp +++ b/src/mesh/http/WebServer.cpp @@ -20,10 +20,8 @@ #ifdef ARCH_ESP32 #include "esp_task_wdt.h" +#include #include -extern "C" { -#include -} #endif // Persistent Data Storage @@ -79,11 +77,11 @@ static bool canAllocateTlsSession() return false; // Held together, through mbedTLS's own allocator, as setup() does: one can fit where two do not. - void *in = esp_mbedtls_mem_calloc(1, TLS_IN_BUFFER_BYTES); - void *out = in ? esp_mbedtls_mem_calloc(1, TLS_OUT_BUFFER_BYTES) : nullptr; + void *in = mbedtls_calloc(1, TLS_IN_BUFFER_BYTES); + void *out = in ? mbedtls_calloc(1, TLS_OUT_BUFFER_BYTES) : nullptr; const bool fits = in && out; - esp_mbedtls_mem_free(out); - esp_mbedtls_mem_free(in); + mbedtls_free(out); + mbedtls_free(in); return fits; }