Commits

Andrew Dunstan committed c71a6b8

make temp hash table in correct memory context

Comments (0)

Files changed (1)

src/backend/utils/adt/jsonfuncs.c

 	JsonLexContext lex;
 	JsonSemAction sem;
 
-
 	memset(&ctl, 0, sizeof(ctl));
 	ctl.keysize = NAMEDATALEN;
 	ctl.entrysize = sizeof(jsonHashEntry);
+	ctl.hcxt = CurrentMemoryContext;
 	tab = hash_create("json object hashtable",
 					  100,
 					  &ctl,
-					  HASH_ELEM);
+					  HASH_ELEM | HASH_CONTEXT);
 
 	state = palloc0(sizeof(jhashState));
 	sem = palloc0(sizeof(jsonSemAction));