Commit 5f2e09bc authored by Tom Lane's avatar Tom Lane

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
parent ea80d8d9
...@@ -2282,7 +2282,7 @@ exec_stmt_call(PLpgSQL_execstate *estate, PLpgSQL_stmt_call *stmt) ...@@ -2282,7 +2282,7 @@ exec_stmt_call(PLpgSQL_execstate *estate, PLpgSQL_stmt_call *stmt)
row->varnos = (int *) palloc(sizeof(int) * list_length(funcargs)); row->varnos = (int *) palloc(sizeof(int) * list_length(funcargs));
if (!local_plan) if (!local_plan)
MemoryContextSwitchTo(get_eval_mcontext(estate)); MemoryContextSwitchTo(get_stmt_mcontext(estate));
/* /*
* Examine procedure's argument list. Each output arg position * Examine procedure's argument list. Each output arg position
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment