diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2020-12-28 11:55:23 -0500 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2020-12-28 11:55:32 -0500 |
commit | 63d78d106d2f69768f9b4c66ff849d95a83205f7 (patch) | |
tree | 86fec9e2bbe3191e0806da48367cf16acdd34558 | |
parent | 0ea25ed108d8344ac17012e62790e7e9ef7f1a7a (diff) | |
download | postgresql-63d78d106d2f69768f9b4c66ff849d95a83205f7.tar.gz postgresql-63d78d106d2f69768f9b4c66ff849d95a83205f7.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
-rw-r--r-- | src/pl/plpgsql/src/pl_exec.c | 2 |
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 462ce4d170e..4e154ae2937 100644 --- a/src/pl/plpgsql/src/pl_exec.c +++ b/src/pl/plpgsql/src/pl_exec.c @@ -2271,7 +2271,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 |