]> granicus.if.org Git - postgresql/commitdiff
Fix transaction-lifespan memory leak in xpath(). Report by Matt Magoffin,
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jul 2008 00:04:24 +0000 (00:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jul 2008 00:04:24 +0000 (00:04 +0000)
fix by Kris Jurka.

src/backend/utils/adt/xml.c

index 514e5ae2bc9720da6d67db8b0c9c4f5ebe2f23a5..799e9a283aafb6eb9e47d4a5950f74a605eb8244 100644 (file)
@@ -7,7 +7,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.74 2008/05/12 00:00:51 alvherre Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.75 2008/07/03 00:04:24 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3160,6 +3160,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur)
        {
                str = xmlXPathCastNodeToString(cur);
                result = (xmltype *) cstring_to_text((char *) str);
+               xmlFree(str);
        }
 
        return result;