diff options
Diffstat (limited to 'contrib/xml2')
-rw-r--r-- | contrib/xml2/Makefile | 3 | ||||
-rw-r--r-- | contrib/xml2/xml2--unpackaged--1.0.sql | 2 | ||||
-rw-r--r-- | contrib/xml2/xpath.c | 3 | ||||
-rw-r--r-- | contrib/xml2/xslt_proc.c | 18 |
4 files changed, 13 insertions, 13 deletions
diff --git a/contrib/xml2/Makefile b/contrib/xml2/Makefile index be3d018cf5..2f7a08cff1 100644 --- a/contrib/xml2/Makefile +++ b/contrib/xml2/Makefile @@ -1,10 +1,11 @@ # contrib/xml2/Makefile MODULE_big = pgxml -OBJS = xpath.o xslt_proc.o +OBJS = xpath.o xslt_proc.o $(WIN32RES) EXTENSION = xml2 DATA = xml2--1.0.sql xml2--unpackaged--1.0.sql +PGFILEDESC = "xml2 - XPath querying and XSLT" REGRESS = xml2 diff --git a/contrib/xml2/xml2--unpackaged--1.0.sql b/contrib/xml2/xml2--unpackaged--1.0.sql index b02dabffc2..8badef3079 100644 --- a/contrib/xml2/xml2--unpackaged--1.0.sql +++ b/contrib/xml2/xml2--unpackaged--1.0.sql @@ -1,7 +1,7 @@ /* contrib/xml2/xml2--unpackaged--1.0.sql */ -- complain if script is sourced in psql, rather than via CREATE EXTENSION -\echo Use "CREATE EXTENSION xml2" to load this file. \quit +\echo Use "CREATE EXTENSION xml2 FROM unpackaged" to load this file. \quit ALTER EXTENSION xml2 ADD function xslt_process(text,text); ALTER EXTENSION xml2 ADD function xslt_process(text,text,text); diff --git a/contrib/xml2/xpath.c b/contrib/xml2/xpath.c index a8b159ebff..655c5322cd 100644 --- a/contrib/xml2/xpath.c +++ b/contrib/xml2/xpath.c @@ -23,7 +23,6 @@ #include <libxml/xmlerror.h> #include <libxml/parserInternals.h> - PG_MODULE_MAGIC; /* exported for use by xslt_proc.c */ @@ -328,7 +327,7 @@ xpath_string(PG_FUNCTION_ARGS) /* We could try casting to string using the libxml function? */ xpath = (xmlChar *) palloc(pathsize + 9); - strncpy((char *) xpath, "string(", 7); + memcpy((char *) xpath, "string(", 7); memcpy((char *) (xpath + 7), VARDATA(xpathsupp), pathsize); xpath[pathsize + 7] = ')'; xpath[pathsize + 8] = '\0'; diff --git a/contrib/xml2/xslt_proc.c b/contrib/xml2/xslt_proc.c index 9f13787332..343924e991 100644 --- a/contrib/xml2/xslt_proc.c +++ b/contrib/xml2/xslt_proc.c @@ -146,16 +146,16 @@ xslt_process(PG_FUNCTION_ARGS) } PG_CATCH(); { - if (stylesheet != NULL) - xsltFreeStylesheet(stylesheet); if (restree != NULL) xmlFreeDoc(restree); - if (doctree != NULL) - xmlFreeDoc(doctree); - if (xslt_sec_prefs != NULL) - xsltFreeSecurityPrefs(xslt_sec_prefs); if (xslt_ctxt != NULL) xsltFreeTransformContext(xslt_ctxt); + if (xslt_sec_prefs != NULL) + xsltFreeSecurityPrefs(xslt_sec_prefs); + if (stylesheet != NULL) + xsltFreeStylesheet(stylesheet); + if (doctree != NULL) + xmlFreeDoc(doctree); xsltCleanupGlobals(); pg_xml_done(xmlerrcxt, true); @@ -164,11 +164,11 @@ xslt_process(PG_FUNCTION_ARGS) } PG_END_TRY(); - xsltFreeStylesheet(stylesheet); xmlFreeDoc(restree); - xmlFreeDoc(doctree); - xsltFreeSecurityPrefs(xslt_sec_prefs); xsltFreeTransformContext(xslt_ctxt); + xsltFreeSecurityPrefs(xslt_sec_prefs); + xsltFreeStylesheet(stylesheet); + xmlFreeDoc(doctree); xsltCleanupGlobals(); pg_xml_done(xmlerrcxt, false); |