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

From Tom Lane
Subject pgsql: Fix small memory leak in partial-aggregate deserialization funct
Date
Msg-id E1bG63F-0001Gj-50@gemulon.postgresql.org
Whole thread Raw
List 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.1466637736@sss.pgh.pa.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(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Improve user-facing documentation for partial/parallel aggregati
Next
From: Andrew Dunstan
Date:
Subject: pgsql: Add tab completion for pager_min_lines to psql.