Skip to content

Commit c5f4b98

Browse files
committed
Fix transaction-lifespan memory leak in xpath(). Report by Matt Magoffin,
fix by Kris Jurka.
1 parent 1e797d2 commit c5f4b98

File tree

1 file changed

+2
-1
lines changed
  • src/backend/utils/adt

1 file changed

+2
-1
lines changed

src/backend/utils/adt/xml.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.74 2008/05/12 00:00:51 alvherre Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.75 2008/07/03 00:04:24 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -3160,6 +3160,7 @@ xml_xmlnodetoxmltype(xmlNodePtr cur)
31603160
{
31613161
str = xmlXPathCastNodeToString(cur);
31623162
result = (xmltype *) cstring_to_text((char *) str);
3163+
xmlFree(str);
31633164
}
31643165

31653166
return result;

0 commit comments

Comments
 (0)