Files
Naveen Kumar ChaudharyandJerome Forissier 495368c553 cmd: lwip: wget: free mbedtls x509 cert context to avoid memory leak
_set_cacert() calls mbedtls_x509_crt_init(&crt) followed by
mbedtls_x509_crt_parse(), which allocates internal storage (parsed
cert fields, chain links, raw buffers) inside the crt object. The
function then returns on both the error and success paths without
calling mbedtls_x509_crt_free(&crt), so all of that internal state
is leaked when the stack-allocated crt goes out of scope. Every
invocation of "wget cacert ..." leaks memory.

Free the cert object on both return paths.

Signed-off-by: Naveen Kumar Chaudhary <naveen.osdev@gmail.com>
Reviewed-by: Jerome Forissier <jerome.forissier@arm.com>
2026-07-23 17:05:20 +02:00
..
2025-08-18 15:47:58 +02:00
2026-07-23 17:05:20 +02:00
2026-07-23 17:05:20 +02:00