pgsql: Fix small memory leak in partial-aggregate deserialization funct

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix small memory leak in partial-aggregate deserialization funct
Date: 2016-06-23 14:56:17
Message-ID: E1bG63F-0001Gj-50@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix small memory leak in partial-aggregate deserialization functions.

A deserialize function's result is short-lived data during partial
aggregation, since we're just going to pass it to the combine function
and then it's of no use anymore. However, the built-in deserialize
functions allocated their results in the aggregate state context,
resulting in a query-lifespan memory leak. It's probably not possible for
this to amount to anything much at present, since the number of leaked
results would only be the number of worker processes. But it might become
a problem in future. To fix, don't use the same convenience subroutine for
setting up results that the aggregate transition functions use.

David Rowley

Report: <10050(dot)1466637736(at)sss(dot)pgh(dot)pa(dot)us>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/bd1693e89e7e6c458d0563f6cc67a7c99a45251a

Modified Files
--------------
src/backend/utils/adt/numeric.c | 56 +++++++++++++++++++++++++++++++++--------
1 file changed, 45 insertions(+), 11 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andrew Dunstan 2016-06-23 20:13:12 pgsql: Add tab completion for pager_min_lines to psql.
Previous Message Tom Lane 2016-06-22 23:14:25 pgsql: Improve user-facing documentation for partial/parallel aggregati