Files
firmware/src/mesh/eth
Ben Meadors 4296d5d584 fix(eth): free partially initialized TLS contexts on init failure (#11452)
* fix(eth): free partially initialized TLS contexts on init failure

initTlsContext() inits the four mbedtls contexts and populates them step
by step, but every failure return left the already-parsed material
(X.509 chain, EC key, ssl config) allocated. Since tlsReady is only set
after full success, deInitEthTlsApiServer()'s cleanup - guarded by
if (tlsReady) - could never reclaim that partial state, and runOnce()
hard-fails with the contexts stranded for the life of the process. Also
reachable via the cert-regeneration path when a DHCP lease change bumps
the cert generation and the rebuild fails.

Factor the four frees into freeTlsContexts() (safe on init-but-
unpopulated contexts) and call it from every initTlsContext failure
return; deInit now uses the same helper.

* docs(eth): shorten freeTlsContexts comment per review
2026-08-12 19:38:04 -05:00
..
2026-07-01 19:01:27 -05:00
2026-07-01 19:01:27 -05:00
2026-07-01 19:01:27 -05:00
2026-07-01 19:01:27 -05:00
2026-07-01 19:01:27 -05:00