In json code, clean up temp memory contexts after processing.

Craig Ringer.
This commit is contained in:
Andrew Dunstan 2014-02-03 10:39:13 -05:00
parent 1c97ab9251
commit cdfbb78f04

View File

@ -958,6 +958,8 @@ each_worker(PG_FUNCTION_ARGS, bool as_text)
pg_parse_json(lex, sem);
MemoryContextDelete(state->tmp_cxt);
rsi->setResult = state->tuple_store;
rsi->setDesc = state->ret_tdesc;
@ -1125,6 +1127,8 @@ json_array_elements(PG_FUNCTION_ARGS)
pg_parse_json(lex, sem);
MemoryContextDelete(state->tmp_cxt);
rsi->setResult = state->tuple_store;
rsi->setDesc = state->ret_tdesc;