static char *
xml_out_internal(xmltype *x, pg_enc target_encoding)
{
- char *str;
- size_t len;
+ char *str = text_to_cstring((text *) x);
#ifdef USE_LIBXML
+ size_t len = strlen(str);
xmlChar *version;
- xmlChar *encoding;
int standalone;
int res_code;
-#endif
-
- str = text_to_cstring((text *) x);
- len = strlen(str);
-#ifdef USE_LIBXML
if ((res_code = parse_xml_decl((xmlChar *) str,
- &len, &version, &encoding, &standalone)) == 0)
+ &len, &version, NULL, &standalone)) == 0)
{
StringInfoData buf;
}
appendStringInfoString(&buf, str + len);
+ if (version)
+ xmlFree(version);
+ pfree(str);
+
return buf.data;
}