On 30.03.2011 21:21, Jan Urbański wrote:
> Valgrind showed me the way. PFA a trivial patch to avoid leaking a
> PLyProcedure struct in inline blocks.
Hmm, any reason the PLyProcedure struct needs to be allocated in
TopMemoryContext in the first place? Could you palloc0 it in a
shorter-lived context, or even better, just allocate it in stack?
PS. I don't think the volatile qualifier in 'proc' is in necessary. The
variable is not changed in PG_TRY-block.
--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com