Skip to content

Commit d5f014d

Browse files
committed
Remove unnecessary complication around xmlParseBalancedChunkMemory.
When I prepared 71c0921 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 6082b3d.) 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
1 parent 1fe9e38 commit d5f014d

File tree

1 file changed

+1
-9
lines changed
  • src/backend/utils/adt

1 file changed

+1
-9
lines changed

src/backend/utils/adt/xml.c

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1883,24 +1883,16 @@ xml_parse(text *data, XmlOptionType xmloption_arg,
18831883
/* allow empty content */
18841884
if (*(utf8string + count))
18851885
{
1886-
xmlNodePtr node_list = NULL;
1887-
18881886
res_code = xmlParseBalancedChunkMemory(doc, NULL, NULL, 0,
18891887
utf8string + count,
1890-
&node_list);
1888+
parsed_nodes);
18911889
if (res_code != 0 || xmlerrcxt->err_occurred)
18921890
{
18931891
xml_errsave(escontext, xmlerrcxt,
18941892
ERRCODE_INVALID_XML_CONTENT,
18951893
"invalid XML content");
1896-
xmlFreeNodeList(node_list);
18971894
goto fail;
18981895
}
1899-
1900-
if (parsed_nodes != NULL)
1901-
*parsed_nodes = node_list;
1902-
else
1903-
xmlFreeNodeList(node_list);
19041896
}
19051897
}
19061898

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy