aboutsummaryrefslogtreecommitdiff
path: root/contrib/postgres_fdw/postgres_fdw.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-02-10 13:37:12 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2018-02-10 13:37:12 -0500
commitd02d4a6d4f27c223f48b03a5e651a22c8460b3c4 (patch)
tree56ba6e73f52d18dd8e45fb5f761de2428ad73f62 /contrib/postgres_fdw/postgres_fdw.c
parent65b1d767856d96c7d6f952f30890dd5b7d4b66bb (diff)
downloadpostgresql-d02d4a6d4f27c223f48b03a5e651a22c8460b3c4.tar.gz
postgresql-d02d4a6d4f27c223f48b03a5e651a22c8460b3c4.zip
Avoid premature free of pass-by-reference CALL arguments.
Prematurely freeing the EState used to evaluate CALL arguments led, in some cases, to passing dangling pointers to the procedure. This was masked in trivial cases because the argument pointers would point to Const nodes in the original expression tree, and in some other cases because the result value would end up in the standalone ExprContext rather than in memory belonging to the EState --- but that wasn't exactly high quality programming either, because the standalone ExprContext was never explicitly freed, breaking assorted API contracts. In addition, using a separate EState for each argument was just silly. So let's use just one EState, and one ExprContext, and make the latter belong to the former rather than be standalone, and clean up the EState (and hence the ExprContext) post-call. While at it, improve the function's commentary a bit. Discussion: https://postgr.es/m/29173.1518282748@sss.pgh.pa.us
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
0 files changed, 0 insertions, 0 deletions