From 765133a3bd6bb10e84e2e3fe52467f102195e586 Mon Sep 17 00:00:00 2001 From: brunoherbelin Date: Sun, 11 Apr 2021 15:24:24 +0200 Subject: [PATCH] BugFix --- tinyxml2Toolkit.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tinyxml2Toolkit.cpp b/tinyxml2Toolkit.cpp index 9c92026..0bab3ea 100644 --- a/tinyxml2Toolkit.cpp +++ b/tinyxml2Toolkit.cpp @@ -129,7 +129,7 @@ XMLElement *tinyxml2::XMLElementEncodeArray(XMLDocument *doc, const void *array, gchar *compressed_array = g_new(gchar, compressed_size); // encoded string will hold the base64 encoding of the array - gchar *encoded_array = nullptr; + const gchar *encoded_array = nullptr; // zlib compress ((Bytef *dest, uLongf *destLen, const Bytef *source, uLong sourceLen)); if ( Z_OK == compress((Bytef *)compressed_array, &compressed_size, @@ -153,7 +153,6 @@ XMLElement *tinyxml2::XMLElementEncodeArray(XMLDocument *doc, const void *array, // free temporary array g_free(compressed_array); - g_free(encoded_array); return newelement; }