]> 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:34 +0000 (00:04 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 3 Jul 2008 00:04:34 +0000 (00:04 +0000)
fix by Kris Jurka.

src/backend/utils/adt/xml.c

index 21341a03a7f0c5a18f53d9ae36450e3852916341..7a627b7683bedfbc8f7ceb9ac85043efc68a76d1 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.68.2.2 2008/03/24 19:12:58 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.68.2.3 2008/07/03 00:04:34 tgl Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -3201,6 +3201,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur)
                result = (text *) palloc(len + VARHDRSZ);
                SET_VARSIZE(result, len + VARHDRSZ);
                memcpy(VARDATA(result), str, len);
+               xmlFree(str);
        }
 
        return result;