summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-07-29 12:47:20 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2025-07-29 12:47:20 -0400
commit0ae824704070dd4beaa77ef8840017ba2601affc (patch)
tree2ca3fd76d526d83169a4870f044b205b8c1b239b /src
parent907ac2ca30bbe7e91959f42f8e420191bb1f2708 (diff)
Remove unnecessary complication around xmlParseBalancedChunkMemory.
When I prepared 71c0921b6 et al yesterday, I was thinking that the logic involving explicitly freeing the node_list output was still needed to dodge leakage bugs in libxml2. But I was misremembering: we introduced that only because with early 2.13.x releases we could not trust xmlParseBalancedChunkMemory's result code, so we had to look to see if a node list was returned or not. There's no reason to believe that xmlParseBalancedChunkMemory will fail to clean up the node list when required, so simplify. (This essentially completes reverting all the non-cosmetic changes in 6082b3d5d.) Reported-by: Jim Jones <jim.jones@uni-muenster.de> Author: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/997668.1753802857@sss.pgh.pa.us Backpatch-through: 13
Diffstat (limited to 'src')
-rw-r--r--src/backend/utils/adt/xml.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/backend/utils/adt/xml.c b/src/backend/utils/adt/xml.c
index 8d7f084e7b5..4cb1d5d9d6c 100644
--- a/src/backend/utils/adt/xml.c
+++ b/src/backend/utils/adt/xml.c
@@ -1623,14 +1623,9 @@ xml_parse(text *data, XmlOptionType xmloption_arg, bool preserve_whitespace,
/* allow empty content */
if (*(utf8string + count))
{
- xmlNodePtr node_list = NULL;
-
res_code = xmlParseBalancedChunkMemory(doc, NULL, NULL, 0,
utf8string + count,
- &node_list);
-
- xmlFreeNodeList(node_list);
-
+ NULL);
if (res_code != 0 || xmlerrcxt->err_occurred)
xml_ereport(xmlerrcxt, ERROR, ERRCODE_INVALID_XML_CONTENT,
"invalid XML content");