aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2025-01-11 11:45:56 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2025-01-11 11:45:56 -0500
commit29dfffae0a6db6cb880ae873169f5512ddab703d (patch)
tree061962bcc042fbe390338359ee8f8867470e5ec4 /src/backend/access/gist
parentca87c415e2fccf81cec6fd45698dde9fae0ab570 (diff)
downloadpostgresql-29dfffae0a6db6cb880ae873169f5512ddab703d.tar.gz
postgresql-29dfffae0a6db6cb880ae873169f5512ddab703d.zip
Repair memory leaks in plpython.
PLy_spi_execute_plan (PLyPlan.execute) and PLy_cursor_plan (plpy.cursor) use PLy_output_convert to convert Python values into Datums that can be passed to the query-to-execute. But they failed to pay much attention to its warning that it can leave "cruft generated along the way" behind. Repeated use of these methods can result in a substantial memory leak for the duration of the calling plpython function. To fix, make a temporary memory context to invoke PLy_output_convert in. This also lets us get rid of the rather fragile code that was here for retail pfree's of the converted Datums. Indeed, we don't need the PLyPlanObject.values field anymore at all, though I left it in place in the back branches in the name of ABI stability. Mat Arye and Tom Lane, per report from Mat Arye. Back-patch to all supported branches. Discussion: https://postgr.es/m/CADsUR0DvVgnZYWwnmKRK65MZg7YLUSTDLV61qdnrwtrAJgU6xw@mail.gmail.com
Diffstat (limited to 'src/backend/access/gist')
0 files changed, 0 insertions, 0 deletions