aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2020-12-28 11:55:23 -0500
committerTom Lane <tgl@sss.pgh.pa.us>2020-12-28 11:55:37 -0500
commitd37965965ad30aacad4d46cfa5ca42b416331ce6 (patch)
tree8bd0cbef2bccb9198070020886e9f85e6643aba4 /src
parentfd1347f9d8def3a892a7335ec026bff0227db1af (diff)
downloadpostgresql-d37965965ad30aacad4d46cfa5ca42b416331ce6.tar.gz
postgresql-d37965965ad30aacad4d46cfa5ca42b416331ce6.zip
Further fix thinko in plpgsql memory leak fix.
There's a second call of get_eval_mcontext() that should also be get_stmt_mcontext(). This is actually dead code, since no interesting allocations happen before switching back to the original context, but we should keep it in sync with the other call to forestall possible future bugs. Discussion: https://postgr.es/m/f075f7be-c654-9aa8-3ffc-e9214622f02a@enterprisedb.com
Diffstat (limited to 'src')
-rw-r--r--src/pl/plpgsql/src/pl_exec.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pl/plpgsql/src/pl_exec.c b/src/pl/plpgsql/src/pl_exec.c
index e0c49c1e266..d380e2ec61d 100644
--- a/src/pl/plpgsql/src/pl_exec.c
+++ b/src/pl/plpgsql/src/pl_exec.c
@@ -2259,7 +2259,7 @@ exec_stmt_call(PLpgSQL_execstate *estate, PLpgSQL_stmt_call *stmt)
row->varnos = (int *) palloc(sizeof(int) * list_length(funcargs));
if (!local_plan)
- MemoryContextSwitchTo(get_eval_mcontext(estate));
+ MemoryContextSwitchTo(get_stmt_mcontext(estate));
/*
* Examine procedure's argument list. Each output arg position