From: Benjamin Berg Date: Fri, 21 Nov 2025 13:46:42 +0000 (+0100) Subject: utils: Fix memory leak of base64 decoded XML entries X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0c629322abb975a2e11dec8ed5cf4006a6ef42bd;p=thirdparty%2Fhostap.git utils: Fix memory leak of base64 decoded XML entries A copy is created to append a NUL byte, however the original base64 decoded string was not released. Fixes: 2cb8f967896d ("HS 2.0R2: Add wrapper functions for libxml2") Signed-off-by: Benjamin Berg --- diff --git a/src/utils/xml_libxml2.c b/src/utils/xml_libxml2.c index 50630a925..0aa71d563 100644 --- a/src/utils/xml_libxml2.c +++ b/src/utils/xml_libxml2.c @@ -219,6 +219,7 @@ char * xml_node_get_base64_text(struct xml_node_ctx *ctx, xml_node_t *node, } os_memcpy(txt, ret, len); txt[len] = '\0'; + os_free(ret); return txt; }