Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd5f014d

Browse files
committed
Remove unnecessary complication around xmlParseBalancedChunkMemory.
When I prepared71c0921 et al yesterday, I was thinking that thelogic involving explicitly freeing the node_list output was stillneeded to dodge leakage bugs in libxml2. But I was misremembering:we introduced that only because with early 2.13.x releases we couldnot trust xmlParseBalancedChunkMemory's result code, so we had tolook to see if a node list was returned or not. There's no reasonto believe that xmlParseBalancedChunkMemory will fail to clean upthe node list when required, so simplify. (This essentiallycompletes reverting all the non-cosmetic changes in6082b3d.)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.usBackpatch-through: 13
1 parent1fe9e38 commitd5f014d

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-
xmlNodePtrnode_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
gotofail;
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)

[8]ページ先頭

©2009-2025 Movatter.jp