]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
utils: Fix memory leak of base64 decoded XML entries
authorBenjamin Berg <benjamin.berg@intel.com>
Fri, 21 Nov 2025 13:46:42 +0000 (14:46 +0100)
committerJouni Malinen <j@w1.fi>
Mon, 1 Dec 2025 21:36:53 +0000 (23:36 +0200)
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 <benjamin.berg@intel.com>
src/utils/xml_libxml2.c

index 50630a92549d7655e789194897ea04a139642bcc..0aa71d563fb66b1d6d02012cf2b3123fd3055712 100644 (file)
@@ -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;
 }