Fix small memory leak in partial-aggregate deserialization functions.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Jun 2016 14:55:59 +0000 (10:55 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 23 Jun 2016 14:55:59 +0000 (10:55 -0400)
commitbd1693e89e7e6c458d0563f6cc67a7c99a45251a
tree01fe3bc1b0b99b42348bb1e15dcd609a84edb1c3
parent2d673424faf3e33c5fcca926fbe3f21e16dd0fef
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>
src/backend/utils/adt/numeric.c