From f5eee756e3a85671c56823f2644caab95c7a8ebc Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 30 Nov 2008 18:49:42 +0000 Subject: [PATCH] Remove inappropriate memory context switch in shutdown_MultiFuncCall(). This was a thinko introduced in a patch from last February; it results in memory leakage if an SRF is shut down before the actual end of query, because subsequent code will be running in a longer-lived context than it's expecting to be. --- src/backend/utils/fmgr/funcapi.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/backend/utils/fmgr/funcapi.c b/src/backend/utils/fmgr/funcapi.c index 23db8f4f71..dac0c9a4e0 100644 --- a/src/backend/utils/fmgr/funcapi.c +++ b/src/backend/utils/fmgr/funcapi.c @@ -182,7 +182,6 @@ shutdown_MultiFuncCall(Datum arg) * Delete context that holds all multi-call data, including the * FuncCallContext itself */ - MemoryContextSwitchTo(flinfo->fn_mcxt); MemoryContextDelete(funcctx->multi_call_memory_ctx); } -- 2.39.5