You have a memory error in this patch -- clobbered by pfree:
> Details
> -------
> http://git.postgresql.org/pg/commitdiff/97e0aa697983cf7f7f79e69f2dc248fdefb7dbf6
^^^^ here
Sorry, couldn't resist.
--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services