git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 4d5840c) | patch
Fix two memory leaks around force-storing tuples in slots.
2019年4月19日 18:33:37 +0000 (11:33 -0700)
2019年4月19日 18:39:56 +0000 (11:39 -0700)
commit 88e6ad3054ddd5aa0dee12e5def2c335fe92a414
Fix two memory leaks around force-storing tuples in slots.

As reported by Tom, when ExecStoreMinimalTuple() had to perform a
conversion to store the minimal tuple in the slot, it forgot to
respect the shouldFree flag, and leaked the tuple into the current
memory context if true. Fix that by freeing the tuple in that case.

Looking at the relevant code made me (Andres) realize that not having
the shouldFree parameter to ExecForceStoreHeapTuple() was a bad
idea. Some callers had to locally implement the necessary logic, and
in one case it was missing, creating a potential per-group leak in
non-hashed aggregation.

The choice to not free the tuple in ExecComputeStoredGenerated() is
not pretty, but not introduced by this commit - I'll start a separate
discussion about it.

Reported-By: Tom Lane
Discussion: https://postgr.es/m/366.1555382816@sss.pgh.pa.us
contrib/postgres_fdw/postgres_fdw.c diff | blob | blame | history
src/backend/commands/trigger.c diff | blob | blame | history
src/backend/executor/execTuples.c diff | blob | blame | history
src/backend/executor/nodeAgg.c diff | blob | blame | history
src/backend/executor/nodeIndexonlyscan.c diff | blob | blame | history
src/backend/executor/nodeModifyTable.c diff | blob | blame | history
src/include/executor/tuptable.h diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /