]> granicus.if.org Git - postgresql/commitdiff
In json code, clean up temp memory contexts after processing.
authorAndrew Dunstan <andrew@dunslane.net>
Mon, 3 Feb 2014 15:40:12 +0000 (10:40 -0500)
committerAndrew Dunstan <andrew@dunslane.net>
Mon, 3 Feb 2014 15:40:12 +0000 (10:40 -0500)
Craig Ringer.

src/backend/utils/adt/jsonfuncs.c

index a19b2222a2dd78aea7596537ce42a1cd58f289a1..7c07554725961825afb228193d7ff1f313922904 100644 (file)
@@ -972,6 +972,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;
 
@@ -1154,6 +1156,8 @@ elements_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;