Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and xml_parse, all arising from the same sloppy usage of parse_xml_decl. The original coding had that function returning its output string parameters in the libxml context, which is long-lived, and all but one of its callers neglected to free the strings afterwards.  The easiest and most bulletproof fix is to return the strings in the local palloc context instead, since that's short-lived.  This was only costing a dozen or two bytes per function call, but that adds up fast if the function is called repeatedly ...
Fix intratransaction memory leaks in xml_recv, xmlconcat, xmlroot, and
xml_parse, all arising from the same sloppy usage of parse_xml_decl.
The original coding had that function returning its output string
parameters in the libxml context, which is long-lived, and all but one
of its callers neglected to free the strings afterwards.  The easiest
and most bulletproof fix is to return the strings in the local palloc
context instead, since that's short-lived.  This was only costing a
dozen or two bytes per function call, but that adds up fast if the
function is called repeatedly ...

Noted while poking at the more general problem of what to do with our
libxml memory allocation hooks.  Back-patch to 8.3, which has the
identical coding.

rvs/gpdb,kaknikhil/gpdb,lintzc/gpdb,yuanzhao/gpdb,ahachete/gpdb,yuanzhao/gpdb,0x0FFF/gpdb,chrishajas/gpdb,rvs/gpdb,adam8157/gpdb,CraigHarris/gpdb,janebeckman/gpdb,xinzweb/gpdb,xinzweb/gpdb,zaksoup/gpdb,janebeckman/gpdb,lintzc/gpdb,jmcatamney/gpdb,50wu/gpdb,edespino/gpdb,adam8157/gpdb,edespino/gpdb,xinzweb/gpdb,ashwinstar/gpdb,Quikling/gpdb,lisakowen/gpdb,ahachete/gpdb,rvs/gpdb,xinzweb/gpdb,xuegang/gpdb,cjcjameson/gpdb,edespino/gpdb,Chibin/gpdb,greenplum-db/gpdb,royc1/gpdb,adam8157/gpdb,adam8157/gpdb,50wu/gpdb,janebeckman/gpdb,chrishajas/gpdb,yuanzhao/gpdb,zaksoup/gpdb,jmcatamney/gpdb,edespino/gpdb,chrishajas/gpdb,yuanzhao/gpdb,Quikling/gpdb,50wu/gpdb,zaksoup/gpdb,rvs/gpdb,jmcatamney/gpdb,yuanzhao/gpdb,xuegang/gpdb,50wu/gpdb,cjcjameson/gpdb,edespino/gpdb,royc1/gpdb,ashwinstar/gpdb,royc1/gpdb,lintzc/gpdb,cjcjameson/gpdb,edespino/gpdb,cjcjameson/gpdb,rvs/gpdb,kaknikhil/gpdb,50wu/gpdb,Quikling/gpdb,lisakowen/gpdb,rvs/gpdb,jmcatamney/gpdb,ahachete/gpdb,janebeckman/gpdb,0x0FFF/gpdb,royc1/gpdb,xuegang/gpdb,yuanzhao/gpdb,rvs/gpdb,lisakowen/gpdb,lintzc/gpdb,yuanzhao/gpdb,edespino/gpdb,Quikling/gpdb,kaknikhil/gpdb,0x0FFF/gpdb,royc1/gpdb,xinzweb/gpdb,ashwinstar/gpdb,edespino/gpdb,adam8157/gpdb,cjcjameson/gpdb,lisakowen/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,lintzc/gpdb,Quikling/gpdb,Chibin/gpdb,greenplum-db/gpdb,edespino/gpdb,0x0FFF/gpdb,zaksoup/gpdb,janebeckman/gpdb,50wu/gpdb,Chibin/gpdb,greenplum-db/gpdb,kaknikhil/gpdb,jmcatamney/gpdb,CraigHarris/gpdb,Quikling/gpdb,jmcatamney/gpdb,chrishajas/gpdb,janebeckman/gpdb,lintzc/gpdb,Quikling/gpdb,chrishajas/gpdb,adam8157/gpdb,cjcjameson/gpdb,kaknikhil/gpdb,ahachete/gpdb,janebeckman/gpdb,cjcjameson/gpdb,Chibin/gpdb,kaknikhil/gpdb,CraigHarris/gpdb,ashwinstar/gpdb,xuegang/gpdb,kaknikhil/gpdb,xinzweb/gpdb,CraigHarris/gpdb,ahachete/gpdb,royc1/gpdb,ahachete/gpdb,jmcatamney/gpdb,xuegang/gpdb,janebeckman/gpdb,royc1/gpdb,CraigHarris/gpdb,lisakowen/gpdb,zaksoup/gpdb,zaksoup/gpdb,xuegang/gpdb,Chibin/gpdb,Quikling/gpdb,CraigHarris/gpdb,0x0FFF/gpdb,yuanzhao/gpdb,ashwinstar/gpdb,kaknikhil/gpdb,lisakowen/gpdb,lintzc/gpdb,Chibin/gpdb,zaksoup/gpdb,adam8157/gpdb,cjcjameson/gpdb,xuegang/gpdb,CraigHarris/gpdb,zaksoup/gpdb,ahachete/gpdb,jmcatamney/gpdb,cjcjameson/gpdb,yuanzhao/gpdb,xinzweb/gpdb,chrishajas/gpdb,janebeckman/gpdb,lintzc/gpdb,ahachete/gpdb,Chibin/gpdb,edespino/gpdb,janebeckman/gpdb,chrishajas/gpdb,lisakowen/gpdb,chrishajas/gpdb,50wu/gpdb,0x0FFF/gpdb,greenplum-db/gpdb,Quikling/gpdb,Chibin/gpdb,xinzweb/gpdb,ashwinstar/gpdb,Chibin/gpdb,0x0FFF/gpdb,rvs/gpdb,greenplum-db/gpdb,ashwinstar/gpdb,rvs/gpdb,kaknikhil/gpdb,lintzc/gpdb,0x0FFF/gpdb,CraigHarris/gpdb,xuegang/gpdb,lisakowen/gpdb,rvs/gpdb,CraigHarris/gpdb,xuegang/gpdb,cjcjameson/gpdb,Quikling/gpdb,ashwinstar/gpdb,greenplum-db/gpdb,50wu/gpdb,Chibin/gpdb,adam8157/gpdb,greenplum-db/gpdb,yuanzhao/gpdb,royc1/gpdb