Re: BUG #5842: Memory leak in PL/Python when taking slices of results - Mailing list pgsql-bugs

From Alvaro Herrera
Subject Re: BUG #5842: Memory leak in PL/Python when taking slices of results
Date
Msg-id 1300386599-sup-6152@alvh.no-ip.org
Whole thread Raw
In response to BUG #5842: Memory leak in PL/Python when taking slices of results  ("Daniel Popowich" <danielpopowich@gmail.com>)
List pgsql-bugs
Excerpts from Daniel Popowich's message of mar ene 18 13:30:04 -0300 2011:

> I traced the bug to PLy_result_slice() in src/pl/plpython/plpython.c.  That
> function calls the python API function PyList_GetSlice() and erroneously
> increments the reference count before returning the result to the caller.
> PyList_GetSlice returns a *new* reference, not a borrowed one, so it should
> just return the object as-is.
>
> A patch is attached below.

Thanks, applied and backpatched all the way back to 8.2.

--
Álvaro Herrera <alvherre@commandprompt.com>
The PostgreSQL Company - Command Prompt, Inc.
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

pgsql-bugs by date:

Previous
From: Tambet Matiisen
Date:
Subject: Re: BUG #5929: ERROR: found toasted toast chunk for toast value 260340218 in pg_toast_260339342
Next
From: "Brad Nicholson"
Date:
Subject: BUG #5935: Log lotation not working for default log format