aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-12-30 13:33:09 +0900
committerMichael Paquier <michael@paquier.xyz>2024-12-30 13:33:09 +0900
commitc9b3d4909bbfcaa8cc2ed434d12a562fb30fe422 (patch)
tree7c6952aa4c641e2fd8c9c4b8ec4e7d56041effc9 /src/backend/commands/explain.c
parentebf2ab40e5e1b0545257e8b27a1d48e9488c23f4 (diff)
downloadpostgresql-c9b3d4909bbfcaa8cc2ed434d12a562fb30fe422.tar.gz
postgresql-c9b3d4909bbfcaa8cc2ed434d12a562fb30fe422.zip
Fix memory leak in pgoutput with relation attribute map
pgoutput caches the attribute map of a relation, that is free()'d only when validating a RelationSyncEntry. However, this code path is not taken when calling any of the SQL functions able to do some logical decoding, like pg_logical_slot_{get,peek}_changes(), leaking some memory into CacheMemoryContext on repeated calls. To address this, a relation's attribute map is allocated in PGOutputData's cachectx, free()'d at the end of the execution of these SQL functions when logical decoding ends. This is available down to 15. v13 and v14 have a similar leak, which will be dealt with later. Reported-by: Masahiko Sawada Author: Vignesh C Reviewed-by: Hou Zhijie Discussion: https://postgr.es/m/CAD21AoDkAhQVSukOfH3_reuF-j4EU0-HxMqU3dU+bSTxsqT14Q@mail.gmail.com Discussion: https://postgr.es/m/CALDaNm1hewNAsZ_e6FF52a=9drmkRJxtEPrzCB6-9mkJyeBBqA@mail.gmail.com Backpatch-through: 15
Diffstat (limited to 'src/backend/commands/explain.c')
0 files changed, 0 insertions, 0 deletions