Re: SRF memory leaks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Neil Conway <neilc(at)samurai(dot)com>
Cc: Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: SRF memory leaks
Date: 2008-02-26 02:00:29
Message-ID: 20396.1203991229@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

Neil Conway <neilc(at)samurai(dot)com> writes:
> if (funcTupdesc)
> + {
> tupledesc_match(node->tupdesc, funcTupdesc);
> + FreeTupleDesc(funcTupdesc);
> + }
> }

I find this part of the patch to be a seriously bad idea.
nodeFunctionscan has no right to assume that the function has returned
an expendable tupdesc; indeed, I would think that the other case is
more nearly what's expected by the API for SRFs. We certainly daren't
backpatch such a change.

A safer fix would be to try to make the tupdesc be in the new
multi_call_ctx when it's being created by the funcapi.c code.

regards, tom lane

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2008-02-26 02:03:36 Re: Shlib exports file refactoring
Previous Message Tom Lane 2008-02-26 00:51:22 Re: Fix pgstatindex using for large indexes