Re: pl/python tracebacks

Peter Eisentraut <peter_e@gmx.net>

From: Peter Eisentraut <peter_e@gmx.net>
To: Alex Hunsaker <badalex@gmail.com>
Cc: Jan Urbański <wulczer@wulczer.org>, Postgres - Hackers <pgsql-hackers@postgresql.org>
Date: 2011-02-24T12:46:00Z
Lists: pgsql-hackers
On lör, 2011-02-12 at 02:00 -0700, Alex Hunsaker wrote:
> PyString_AsString is used all over the place without any pfrees. But I
> have no Idea how that pstrdup() is getting freed if at all.

pstrdup() like palloc() allocates memory from the current memory
context, which is freed automatically at some useful time, often at the
end of the query.  It is very common throughout the PostgreSQL code that
memory is not explicitly freed.  See src/backend/utils/mmgr/README for
more information.