Skip to content

Commit ce91be3

Browse files
author
Artur Zakirov
committed
Fix invalid memory context
1 parent 4ed6fc7 commit ce91be3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ruminsert.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,7 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
629629
ALLOCSET_DEFAULT_INITSIZE,
630630
ALLOCSET_DEFAULT_MAXSIZE);
631631

632-
buildstate.funcCtx = AllocSetContextCreate(buildstate.tmpCtx,
632+
buildstate.funcCtx = AllocSetContextCreate(CurrentMemoryContext,
633633
"Rum build temporary context for user-defined function",
634634
ALLOCSET_DEFAULT_MINSIZE,
635635
ALLOCSET_DEFAULT_INITSIZE,
@@ -670,6 +670,7 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
670670
}
671671
MemoryContextSwitchTo(oldCtx);
672672

673+
MemoryContextDelete(buildstate.funcCtx);
673674
MemoryContextDelete(buildstate.tmpCtx);
674675

675676
/*

0 commit comments

Comments
 (0)