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

Commit762c6d8

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 parentd861b92 commit762c6d8

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
@@ -1862,24 +1862,16 @@ xml_parse(text *data, XmlOptionType xmloption_arg,
18621862
/* allow empty content */
18631863
if (*(utf8string+count))
18641864
{
1865-
xmlNodePtrnode_list=NULL;
1866-
18671865
res_code=xmlParseBalancedChunkMemory(doc,NULL,NULL,0,
18681866
utf8string+count,
1869-
&node_list);
1867+
parsed_nodes);
18701868
if (res_code!=0||xmlerrcxt->err_occurred)
18711869
{
18721870
xml_errsave(escontext,xmlerrcxt,
18731871
ERRCODE_INVALID_XML_CONTENT,
18741872
"invalid XML content");
1875-
xmlFreeNodeList(node_list);
18761873
gotofail;
18771874
}
1878-
1879-
if (parsed_nodes!=NULL)
1880-
*parsed_nodes=node_list;
1881-
else
1882-
xmlFreeNodeList(node_list);
18831875
}
18841876
}
18851877

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp