Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-patches by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group