summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2018-01-26 09:51:15 -0500
committerRobert Haas <rhaas@postgresql.org>2018-01-26 09:59:14 -0500
commit51fc1b09a3baa5361a15c4d4ec4faa74a3a3cee0 (patch)
treea035c0b42eec7b651b41d6f4cbf0cf5fcba4ba0c
parent48de935b08895d6562f27105ff3bd2b7ef8e5775 (diff)
pageinspect: Fix use of wrong memory context by hash_page_items.
This can cause it to produce incorrect output. Report and patch by Masahiko Sawada. Discussion: http://postgr.es/m/CAD21AoBc5Asx7pXdUWu6NqU_g=Ysn95EGL9SMeYhLLduYoO_OA@mail.gmail.com
-rw-r--r--contrib/pageinspect/hashfuncs.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pageinspect/hashfuncs.c b/contrib/pageinspect/hashfuncs.c
index dbe3b6ab046..778e15dde49 100644
--- a/contrib/pageinspect/hashfuncs.c
+++ b/contrib/pageinspect/hashfuncs.c
@@ -313,10 +313,10 @@ hash_page_items(PG_FUNCTION_ARGS)
fctx = SRF_FIRSTCALL_INIT();
- page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
-
mctx = MemoryContextSwitchTo(fctx->multi_call_memory_ctx);
+ page = verify_hash_page(raw_page, LH_BUCKET_PAGE | LH_OVERFLOW_PAGE);
+
uargs = palloc(sizeof(struct user_args));
uargs->page = page;