"Andrew Gilligan" <andy@tcpd.net> writes:
> It seems there exists a bug in the way character set conversion
> is handled in some circumstances.
Seems to be the bogus pfree() in pg_convert_from() that's causing
the problem :-(. Take that out and you should be OK.
Thanks for the report!
regards, tom lane